org.apache.jackrabbit.net
Class URLFactory

java.lang.Object
  extended by org.apache.jackrabbit.net.URLFactory

public final class URLFactory
extends Object

The URLFactory class provides factory methods for creating JCR Repository and JCRJar URLs.

This class is not intended to be subclassed or instantiated by clients.

Author:
Felix Meschberger

Field Summary
static String REPOSITORY_JAR_SCHEME
          The scheme for JCRJar URLs (value is "jar").
static String REPOSITORY_SCHEME
          The scheme for JCR Repository URLs (value is "jcr").
 
Method Summary
static URL createJarURL(Session session, String path, String entry)
          Creates a new JCRJar URL for the given session, archive and entry.
static URL createURL(Session session, String path)
          Creates a new JCR Repository URL for the given session and item path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY_SCHEME

public static final String REPOSITORY_SCHEME
The scheme for JCR Repository URLs (value is "jcr").

See Also:
Constant Field Values

REPOSITORY_JAR_SCHEME

public static final String REPOSITORY_JAR_SCHEME
The scheme for JCRJar URLs (value is "jar").

See Also:
Constant Field Values
Method Detail

createURL

public static URL createURL(Session session,
                            String path)
                     throws MalformedURLException
Creates a new JCR Repository URL for the given session and item path.

Parameters:
session - The repository session providing access to the item.
path - The absolute path to the item. This must be an absolute path with a leading slash character. If this is null the root node path - / - is assumed.
Returns:
The JCR Repository URL
Throws:
MalformedURLException - If an error occurrs creating the URL instance.

createJarURL

public static URL createJarURL(Session session,
                               String path,
                               String entry)
                        throws MalformedURLException
Creates a new JCRJar URL for the given session, archive and entry.

Parameters:
session - The repository session providing access to the archive.
path - The absolute path to the archive. This must either be the property containing the archive or an item which resolves to such a property through its primary item chain. This must be an absolute path with a leading slash character. If this is null the root node path - / - is assumed.
entry - The entry within the archive. If null, the URL provides access to the archive itself.
Returns:
The JCRJar URL
Throws:
MalformedURLException - If an error occurrs creating the URL instance.


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.