org.licas.util

## Class UriHandler

- java.lang.Object
- - org.licas.util.UriHandler

-     public class UriHandler
      extends java.lang.Object

  This class can be used to try to extract certain information form uri paths.
  Author:
    Kieran

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UriHandler()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `addJarFactoryPrefix(java.lang.String theJarFile)` Add the jar factory prefix to define a jar file in the local services folder.
    `static java.lang.String` | `addLocalFileUriPrefix(java.lang.String theFilePath)` Add the uri file prefix to define a file in the local system.
    `static java.lang.String` | `createJarFactoryUri(java.lang.String ipAddress, java.lang.String password, java.lang.String jarFileName)` Create the jar factory uri string from the required values.
    `static java.lang.String` | `getFileName(java.lang.String uriString)` Try to parse the uri object to extract the final file name from the path.
    `static java.lang.String[]` | `getJarFactoryParsed(java.lang.String theJarFile)` Get an array the stores the different jar file values for retrieving from a remote server's jar factory.
    `static boolean` | `isJarfactoryFile(java.lang.String fileUri)` Return true if the file is defined as a file from the local services folder.
    `static java.lang.String` | `removeJarFactoryPrefix(java.lang.String theJarFile)` Remove the jar factory prefix from the jar file description if it exists.
    `static java.lang.String` | `removeLocalFileUriPrefix(java.lang.String theFilePath)` Remove the the uri file prefix from the local file description if it exists.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UriHandler

          public UriHandler()

  - ### Method Detail

    - #### isJarfactoryFile

          public static boolean isJarfactoryFile(java.lang.String fileUri)

      Return true if the file is defined as a file from the local services folder.
      Parameters:
        `fileUri` - the file uri path.
      Returns:
        true if it has the jarfactory prefix.

    - #### addLocalFileUriPrefix

          public static java.lang.String addLocalFileUriPrefix(java.lang.String theFilePath)

      Add the uri file prefix to define a file in the local system.
      Parameters:
        `theFilePath` - the file path for the jar file.
      Returns:
        the full file path specification.

    - #### removeLocalFileUriPrefix

          public static java.lang.String removeLocalFileUriPrefix(java.lang.String theFilePath)

      Remove the the uri file prefix from the local file description if it exists.
      Parameters:
        `theFilePath` - the file path for the jar file.
      Returns:
        the file path with the prefix removed, or the same path if there is no prefix.

    - #### addJarFactoryPrefix

          public static java.lang.String addJarFactoryPrefix(java.lang.String theJarFile)

      Add the jar factory prefix to define a jar file in the local services folder.
      Parameters:
        `theJarFile` - the file path for the jar file.
      Returns:
        the full jar path specification.

    - #### removeJarFactoryPrefix

          public static java.lang.String removeJarFactoryPrefix(java.lang.String theJarFile)

      Remove the jar factory prefix from the jar file description if it exists.
      Parameters:
        `theJarFile` - the file path for the jar file.
      Returns:
        the file path with the jar factory prefix removed, or the same path if there is no prefix.

    - #### createJarFactoryUri

          public static java.lang.String createJarFactoryUri(java.lang.String ipAddress,
                                                             java.lang.String password,
                                                             java.lang.String jarFileName)

      Create the jar factory uri string from the required values.
      Parameters:
        `ipAddress` - the ip address of the server the factory runs on.
        `password` - the server password.
        `jarFileName` - the name of the jar file.
      Returns:
        the jar factory uri string of combined input values.

    - #### getJarFactoryParsed

          public static java.lang.String[] getJarFactoryParsed(java.lang.String theJarFile)

      Get an array the stores the different jar file values for retrieving from a remote server's jar factory.
      Parameters:
        `theJarFile` - the original jar uri.
      Returns:
        a parsed version of the jar uri.

    - #### getFileName

          public static java.lang.String getFileName(java.lang.String uriString)

      Try to parse the uri object to extract the final file name from the path. The uri can represent any conventional path object, such as a 'URL' of a 'File'.
      Parameters:
        `uriString` - the full path as a string-based description.
      Returns:
        the final file path part if it exists. Also checks that the uri is well formed.