org.openjump.util
Class UriUtil

java.lang.Object
  extended by org.openjump.util.UriUtil

public final class UriUtil
extends java.lang.Object

Utility class for handline URI.

Author:
Paul Austin

Method Summary
static java.lang.String getFileExtension(java.net.URI uri)
          Get the file extension from the URI path.
static java.lang.String getFileName(java.net.URI uri)
          Get the file name from the URI path.
static java.lang.String getFileNameWithoutExtension(java.net.URI uri)
          Get the file name without the extension from the URI path.
static java.net.URI getUri(java.io.File file, java.util.zip.ZipEntry entry)
          Create a URI to the entry within a ZIP file.
static java.lang.String getZipEntryFilePath(java.net.URI uri)
          Get the path to an entry in a ZIP URI.
static java.lang.String getZipEntryName(java.net.URI uri)
          Get the name of a ZIP file entry from a ZIP URI.
static java.io.File getZipFile(java.net.URI uri)
          Get the ZIP file name from a ZIP URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUri

public static java.net.URI getUri(java.io.File file,
                                  java.util.zip.ZipEntry entry)
Create a URI to the entry within a ZIP file.

Parameters:
file - The ZIP file.
entry - The ZIP entry.
Returns:
The URI.

getZipFile

public static java.io.File getZipFile(java.net.URI uri)
Get the ZIP file name from a ZIP URI.

Parameters:
uri - The URI.
Returns:
The ZIP file.

getZipEntryName

public static java.lang.String getZipEntryName(java.net.URI uri)
Get the name of a ZIP file entry from a ZIP URI.

Parameters:
uri - The URI.
Returns:
The ZIP entry name.

getFileExtension

public static java.lang.String getFileExtension(java.net.URI uri)
Get the file extension from the URI path.

Parameters:
uri - The URI.
Returns:
The file extension.

getFileName

public static java.lang.String getFileName(java.net.URI uri)
Get the file name from the URI path.

Parameters:
uri - The URI.
Returns:
The file name.

getFileNameWithoutExtension

public static java.lang.String getFileNameWithoutExtension(java.net.URI uri)
Get the file name without the extension from the URI path.

Parameters:
uri - The URI.
Returns:
The file name.

getZipEntryFilePath

public static java.lang.String getZipEntryFilePath(java.net.URI uri)
Get the path to an entry in a ZIP URI.

Parameters:
uri - The zip URI
Returns:
The entry's path.