org.netbeans.spi.project.libraries.support
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 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
LibraryTypeProvider s. |
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.
|
public 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()
LibraryTypeProvider
s. This method
is mostly used by LibraryProvider
implementators.LibraryTypeProvider
, never returns null.public static URI convertFilePathToURI(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 March 18 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.