lv.eparaksts.edoc

## Class DataObjectResolver

- java.lang.Object
- - lv.eparaksts.edoc.DataObjectResolver

-     public class DataObjectResolver
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataObjectResolver()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `decodeTempFileName(String encodedFileName, Map<String,String> encodedFileNameMap)` Decodes filename as RAW filename.
    `static String` | `decodeUriToPath(String uri)`
    `static URI` | `encodePathToUri(String path)`
    `static String` | `encodeTempFileName(String rawFileName, Map<String,String> encodedFileNameMap)` Encodes RAW filename to use as OS independent temporary filename.
    `static DataObject` | `resolveDataFileByName(File docRoot, String name)` Resolves DataObject by the given name.
    `static DataObject` | `resolveDataFileByUri(File docRoot, URI uri)`

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

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

- - ### Constructor Detail

    - #### DataObjectResolver

          public DataObjectResolver()

  - ### Method Detail

    - #### encodePathToUri

          public static URI encodePathToUri(String path)
                                     throws URISyntaxException

      Throws:
        `URISyntaxException`

    - #### decodeUriToPath

          public static String decodeUriToPath(String uri)
                                        throws UnsupportedEncodingException

      Throws:
        `UnsupportedEncodingException`

    - #### resolveDataFileByName

          public static DataObject resolveDataFileByName(File docRoot,
                                                         String name)

      Resolves DataObject by the given name.
      Parameters:
        `docRoot` - document root directory.
        `name` - RAW unencoded filename as defined in 'Open Document Format : manifest'.
      Returns:
        DataObject or null.
      See Also:
        `encodePathToUri(String)`

    - #### resolveDataFileByUri

          public static DataObject resolveDataFileByUri(File docRoot,
                                                        URI uri)
                                                 throws URISyntaxException,
                                                        IOException

      Throws:
        `URISyntaxException`
        `IOException`

    - #### encodeTempFileName

          public static String encodeTempFileName(String rawFileName,
                                                  Map<String,String> encodedFileNameMap)
                                           throws URISyntaxException

      Encodes RAW filename to use as OS independent temporary filename.
      Parameters:
        `rawFileName` - RAW filename.
        `encodedFileNameMap` - map where to store the encoded name pair.
      Returns:
        encoded name.
      Throws:
        `URISyntaxException`

    - #### decodeTempFileName

          public static String decodeTempFileName(String encodedFileName,
                                                  Map<String,String> encodedFileNameMap)
                                           throws UnsupportedEncodingException

      Decodes filename as RAW filename.
      Parameters:
        `encodedFileName` - encoded filename.
        `encodedFileNameMap` - map where to lookup the encoded name pair.
      Returns:
        decoded name.
      Throws:
        `UnsupportedEncodingException`

Copyright VAS Latvijas Valsts radio un televizijas centrs / Developed by SIA EUSO