org.netbeans.modules.project.libraries/1 1.29.1

org.netbeans.spi.project.libraries.support
Class LibrariesSupport

java.lang.Object
  extended by org.netbeans.spi.project.libraries.support.LibrariesSupport

public final class LibrariesSupport
extends Object

SPI Support class. Provides factory method for creating instance of the default LibraryImplementation.


Method Summary
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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createLibraryImplementation

public static LibraryImplementation createLibraryImplementation(String libraryType,
                                                                String[] volumeTypes)
Creates default LibraryImplementation

Parameters:
libraryType - type of library
volumeTypes - types of supported volumes
Returns:
LibraryImplementation, never return null

getLibraryTypeProvider

public static LibraryTypeProvider getLibraryTypeProvider(String libraryType)
Returns registered LibraryTypeProvider for given library type. This method is mostly used by LibraryProvider implementators.

Parameters:
libraryType - the type of library for which the provider should be returned.
Returns:
LibraryTypeProvider for given library type or null, if none is registered.
Since:
org.netbeans.modules.project.libraries/1 1.14

getLibraryTypeProviders

public static LibraryTypeProvider[] getLibraryTypeProviders()
Returns all registered LibraryTypeProviders. This method is mostly used by LibraryProvider implementators.

Returns:
an array of LibraryTypeProvider, never returns null.
Since:
org.netbeans.modules.project.libraries/1 1.14

convertFilePathToURI

public static URI convertFilePathToURI(String path)
Properly converts possibly relative file path to URI.

Parameters:
path - file path to convert; can be relative; cannot be null
Returns:
uri
Since:
org.netbeans.modules.project.libraries/1 1.18

convertURIToFilePath

public static String convertURIToFilePath(URI uri)
Properly converts possibly relative URI to file path.

Parameters:
uri - URI convert; can be relative URI; cannot be null
Returns:
file path
Since:
org.netbeans.modules.project.libraries/1 1.18

resolveLibraryEntryFileObject

public static FileObject resolveLibraryEntryFileObject(URL libraryLocation,
                                                       URI libraryEntry)
Helper method to resolve (possibly relative) library content URI to FileObject.

Parameters:
libraryLocation - library location file; can be null for global libraries
libraryEntry - library entry to resolve
Returns:
file object
Since:
org.netbeans.modules.project.libraries/1 1.18

resolveLibraryEntryURI

public static URI resolveLibraryEntryURI(URL libraryLocation,
                                         URI libraryEntry)
Helper method to resolve (possibly relative) library content URI.

Parameters:
libraryLocation - library location file
libraryEntry - relative library entry to resolve
Returns:
absolute URI
Since:
org.netbeans.modules.project.libraries/1 1.18

getArchiveFile

public static URI getArchiveFile(URI uri)
Returns the URI of the archive file containing the file referred to by a jar-protocol URL. Remember that any path within the archive is discarded so you may need to check for non-root entries.

Parameters:
uri - a URI; can be relative URI
Returns:
the embedded archive URI, or null if the URI is not a jar-protocol URI containing !/
Since:
org.netbeans.modules.project.libraries/1 1.18

getArchiveRoot

public static URI getArchiveRoot(URI uri)
Returns a URI representing the root of an archive.

Parameters:
uri - of a ZIP- (or JAR-) format archive file; can be relative
Returns:
the jar-protocol URI of the root of the archive
Since:
org.netbeans.modules.project.libraries/1 1.18

org.netbeans.modules.project.libraries/1 1.29.1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.