Class RepositoryAddress


  • public class RepositoryAddress
    extends java.lang.Object
    The repository address locates a jcr repository in with a URI representation. It is composed out of a uri and accepts the following formats:
    • scheme://host:port/
    • scheme://host:port/prefix
    • scheme://host:port/prefix/workspace
    • scheme://host:port/prefix/workspace/jcr_root/path
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String JCR_ROOT
      the (virtual) jcr root.
    • Constructor Summary

      Constructors 
      Constructor Description
      RepositoryAddress​(java.lang.String uri)
      Creates a new default repository address.
      RepositoryAddress​(java.net.URI uri)
      Creates a new default repository address.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Credentials getCredentials()
      Returns JCR credentials from the URI or null if no user info is specified.
      java.lang.String getPath()
      Returns the path to a repository item.
      java.net.URI getSpecificURI()
      Returns the specific part of the uri, i.e.
      java.net.URI getURI()
      Returns the uri of this address
      java.lang.String getWorkspace()
      Returns the name of the workspace or null if the default workspace is used.
      int hashCode()
      RepositoryAddress resolve​(java.lang.String path)
      Returns a new repository address with the given path.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • JCR_ROOT

        public static final java.lang.String JCR_ROOT
        the (virtual) jcr root.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RepositoryAddress

        public RepositoryAddress​(@Nonnull
                                 java.lang.String uri)
                          throws java.net.URISyntaxException
        Creates a new default repository address.
        Parameters:
        uri - the uri
        Throws:
        java.net.URISyntaxException - if the uri is not valid
      • RepositoryAddress

        public RepositoryAddress​(@Nonnull
                                 java.net.URI uri)
                          throws java.net.URISyntaxException
        Creates a new default repository address.
        Parameters:
        uri - the uri
        Throws:
        java.net.URISyntaxException - if the uri is not valid
    • Method Detail

      • getURI

        @Nonnull
        public java.net.URI getURI()
        Returns the uri of this address
        Returns:
        the uri of this address
      • resolve

        @Nonnull
        public RepositoryAddress resolve​(@CheckForNull
                                         java.lang.String path)
        Returns a new repository address with the given path.
        Parameters:
        path - the path to include in the new address
        Returns:
        a new repository address
      • getWorkspace

        @CheckForNull
        public java.lang.String getWorkspace()
        Returns the name of the workspace or null if the default workspace is used.
        Returns:
        the name of the workspace or null
      • getSpecificURI

        @Nonnull
        public java.net.URI getSpecificURI()
        Returns the specific part of the uri, i.e. the part that is used to actually connect to the repository
        Returns:
        the specific part
      • getPath

        @Nonnull
        public java.lang.String getPath()
        Returns the path to a repository item. If not explicit path is specified by this address the root path '/' is returned.
        Returns:
        the path to a repository item.
      • getCredentials

        @CheckForNull
        public Credentials getCredentials()
        Returns JCR credentials from the URI or null if no user info is specified.
        Returns:
        the creds
      • toString

        @Nonnull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        same as getURI().toString() with obfuscated user info
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object