org.apache.sling.jcr.resource.internal.helper
Class MapEntry

java.lang.Object
  extended by org.apache.sling.jcr.resource.internal.helper.MapEntry
All Implemented Interfaces:
Comparable<MapEntry>

public class MapEntry
extends Object
implements Comparable<MapEntry>

The MapEntry class represents a mapping entry in the mapping configuration tree at /etc/map.

See Also:
"http://cwiki.apache.org/SLING/flexible-resource-resolution.html"

Constructor Summary
MapEntry(String url, int status, boolean trailingSlash, String... redirect)
           
 
Method Summary
static String appendSlash(String path)
           
 int compareTo(MapEntry m)
           
static List<MapEntry> createMapEntry(String url, Resource resource, boolean trailingSlash)
           
static MapEntry createResolveEntry(String url, Resource resource, boolean trailingSlash)
           
static String fixUriPath(String uriPath)
           
 String getPattern()
           
 String[] getRedirect()
           
 int getStatus()
           
static String getURI(String scheme, String host, int port, String path)
          Returns a string used for matching map entries against the given request or URI parts.
 boolean isInternal()
           
 String[] replace(String value)
           
 String toString()
           
static URI toURI(String uriPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapEntry

public MapEntry(String url,
                int status,
                boolean trailingSlash,
                String... redirect)
Method Detail

appendSlash

public static String appendSlash(String path)

getURI

public static String getURI(String scheme,
                            String host,
                            int port,
                            String path)
Returns a string used for matching map entries against the given request or URI parts.

Parameters:
scheme - The URI scheme
host - The host name
port - The port number. If this is negative, the default value used is 80 unless the scheme is "https" in which case the default value is 443.
path - The (absolute) path
Returns:
The request path string {scheme}://{host}:{port}{path}.

fixUriPath

public static String fixUriPath(String uriPath)

toURI

public static URI toURI(String uriPath)

createResolveEntry

public static MapEntry createResolveEntry(String url,
                                          Resource resource,
                                          boolean trailingSlash)

createMapEntry

public static List<MapEntry> createMapEntry(String url,
                                            Resource resource,
                                            boolean trailingSlash)

replace

public String[] replace(String value)

getPattern

public String getPattern()

getRedirect

public String[] getRedirect()

isInternal

public boolean isInternal()

getStatus

public int getStatus()

compareTo

public int compareTo(MapEntry m)
Specified by:
compareTo in interface Comparable<MapEntry>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.