public final class LibrariesSupport extends Object
| Modifier and Type | Method and Description |
|---|---|
static URI |
convertFilePathToURI(String path)
Properly converts possibly relative file path to URI.
|
static String |
convertURIToFilePath(URI uri)
Properly converts possibly relative URI to file path.
|
static LibraryImplementation |
createLibraryImplementation(String libraryType,
String[] volumeTypes)
Creates default LibraryImplementation
|
static LibraryImplementation3 |
createLibraryImplementation3(String libraryType,
String... volumeTypes)
Creates default
LibraryImplementation3 |
static URI |
getArchiveFile(URI uri)
Returns the URI of the archive file containing the file
referred to by a
jar-protocol URL. |
static URI |
getArchiveRoot(URI uri)
Returns a URI representing the root of an archive.
|
static LibraryTypeProvider |
getLibraryTypeProvider(String libraryType)
Returns registered
LibraryTypeProvider for given library type. |
static LibraryTypeProvider[] |
getLibraryTypeProviders()
Returns all registered
LibraryTypeProviders. |
static FileObject |
resolveLibraryEntryFileObject(URL libraryLocation,
URI libraryEntry)
Helper method to resolve (possibly relative) library content URI to FileObject.
|
static URI |
resolveLibraryEntryURI(URL libraryLocation,
URI libraryEntry)
Helper method to resolve (possibly relative) library content URI.
|
@NonNull public static LibraryImplementation3 createLibraryImplementation3(@NonNull String libraryType, @NonNull String... volumeTypes)
LibraryImplementation3libraryType - type of libraryvolumeTypes - types of supported volumespublic static LibraryImplementation createLibraryImplementation(String libraryType, String[] volumeTypes)
libraryType - type of libraryvolumeTypes - types of supported volumespublic static LibraryTypeProvider getLibraryTypeProvider(String libraryType)
LibraryTypeProvider for given library type. This method
is mostly used by LibraryProvider implementators.libraryType - the type of library for which the provider should be returned.LibraryTypeProvider for given library type or null, if none is registered.public static LibraryTypeProvider[] getLibraryTypeProviders()
LibraryTypeProviders. This method
is mostly used by LibraryProvider implementators.LibraryTypeProvider, never returns null.public static URI convertFilePathToURI(@NonNull String path)
path - file path to convert; can be relative; cannot be nullpublic static String convertURIToFilePath(URI uri)
uri - URI convert; can be relative URI; cannot be nullpublic static FileObject resolveLibraryEntryFileObject(URL libraryLocation, URI libraryEntry)
libraryLocation - library location file; can be null for global librarieslibraryEntry - library entry to resolvepublic static URI resolveLibraryEntryURI(URL libraryLocation, URI libraryEntry)
libraryLocation - library location filelibraryEntry - relative library entry to resolvepublic static URI getArchiveFile(URI uri)
jar-protocol URL.
Remember that any path within the archive is discarded
so you may need to check for non-root entries.uri - a URI; can be relative URIjar-protocol URI containing !/Built on May 26 2013. | Portions Copyright 1997-2013 Oracle. All rights reserved.