issrg.utils
Class WebdavUtil

java.lang.Object
  extended by issrg.utils.WebdavUtil

public class WebdavUtil
extends java.lang.Object

This is a static class which is supposed to do the webdav related issues. No instance of this class is necessary to invoke the metods since it does not store any values. All methods should be idempotent.

Version:
1.0
Author:
Rune Bjerk

Constructor Summary
WebdavUtil()
           
 
Method Summary
static java.lang.String convertDN2URI(java.lang.String dn)
          Converts a String from regular Distinguised Name in the form of: "c=gb, o=permis, cn=John Smith" into a URL string in the form of: "/c=gb/o=Permis/cn=John Smith/
static boolean doesFileExist(java.lang.String url)
           
static javax.naming.directory.Attributes getACs(java.security.Principal user, java.lang.String host, int port)
          This method is used to initalise an HTTP based WebDAV Repository it initialises the HTTP WebDAV socket object and then passes that object with its initialisation parameters to the root getACs method
static javax.naming.directory.Attributes getACs(java.security.Principal user, java.lang.String host, int port, java.lang.String p12filename, java.lang.String p12passphrase)
          This method is used to initalise an SSL based WebDAV Repository it initialise the SSL WebDAV socket object and then passes that object with its initialisation parameters to the root getACs method
static javax.naming.directory.Attributes getACs(java.security.Principal user, java.lang.String host, int port, WebDAVSocket socket)
          The root getACs method that is used to initialise the connection and request and receive attributes from the WebDAV repository
static java.lang.String getHostFromURL(java.lang.String revLoc)
           
static java.lang.String getNameFromURL(java.lang.String location)
           
static java.lang.String getPortFromURL(java.lang.String revLoc)
           
static byte[] getRawAC(java.lang.String url)
           
static java.lang.String[] getSplitDN(java.lang.String dn)
           
static java.lang.String getURIFromURL(java.lang.String revLoc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebdavUtil

public WebdavUtil()
Method Detail

convertDN2URI

public static java.lang.String convertDN2URI(java.lang.String dn)
                                      throws PbaException
Converts a String from regular Distinguised Name in the form of: "c=gb, o=permis, cn=John Smith" into a URL string in the form of: "/c=gb/o=Permis/cn=John Smith/

Parameters:
dn -
Returns:
Throws:
RFC2253ParsingException
PbaException

getSplitDN

public static java.lang.String[] getSplitDN(java.lang.String dn)

getHostFromURL

public static java.lang.String getHostFromURL(java.lang.String revLoc)

getPortFromURL

public static java.lang.String getPortFromURL(java.lang.String revLoc)

getURIFromURL

public static java.lang.String getURIFromURL(java.lang.String revLoc)

getNameFromURL

public static java.lang.String getNameFromURL(java.lang.String location)

doesFileExist

public static boolean doesFileExist(java.lang.String url)

getACs

public static javax.naming.directory.Attributes getACs(java.security.Principal user,
                                                       java.lang.String host,
                                                       int port,
                                                       java.lang.String p12filename,
                                                       java.lang.String p12passphrase)
                                                throws RepositoryException
This method is used to initalise an SSL based WebDAV Repository it initialise the SSL WebDAV socket object and then passes that object with its initialisation parameters to the root getACs method

Parameters:
user - - The Principal about whom the query is made
host - - The WebDAV repositories location
port - - The WebDAV repositories port
p12filename - - The filename of the p12 file for client authn
p12passphrase - - The p12 files passphrase
Returns:
An Attributes object containing the users attributes
Throws:
RepositoryException

getACs

public static javax.naming.directory.Attributes getACs(java.security.Principal user,
                                                       java.lang.String host,
                                                       int port)
                                                throws RepositoryException
This method is used to initalise an HTTP based WebDAV Repository it initialises the HTTP WebDAV socket object and then passes that object with its initialisation parameters to the root getACs method

Parameters:
user - - The Principal about whom the query is made
host - - The WebDAV repositories location
port - - The WebDAV repositories port
Returns:
An Attributes object containing the users attributes
Throws:
RepositoryException

getACs

public static javax.naming.directory.Attributes getACs(java.security.Principal user,
                                                       java.lang.String host,
                                                       int port,
                                                       WebDAVSocket socket)
                                                throws RepositoryException
The root getACs method that is used to initialise the connection and request and receive attributes from the WebDAV repository

Parameters:
user - - The Principal about whom the query is made
host - - The WebDAV repositories location
port - - The WebDAV repositories port
socket - - A WebDAVSocket object representing the connection to the repository object
Returns:
An Attributes object containing the users attributes
Throws:
RepositoryException

getRawAC

public static byte[] getRawAC(java.lang.String url)
                       throws ACNotFoundException
Throws:
ACNotFoundException