Package org.eclipse.osgi.storage

# Class Storage

java.lang.Object
org.eclipse.osgi.storage.Storage

public class Storage extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`Storage.StorageException`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`BUNDLE_DATA_DIR`
`static final String`
`BUNDLE_FILE_NAME`
`static final String`
`DELETE_FLAG`
`static final String`
`ECLIPSE_SYSTEMBUNDLE`
`static final String`
`FRAMEWORK_INFO`
`static final String`
`LIB_TEMP`
`static final int`
`VERSION`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`compact()`
`String`
`copyToTempLibrary(BundleInfo.Generation generation, String absolutePath)`
`BundleFile`
`createBundleFile(File content, BundleInfo.Generation generation, boolean isDirectory, boolean isBase)`
`BundleFile`
`createNestedBundleFile(String nestedDir, BundleFile bundleFile, BundleInfo.Generation generation)`
`BundleFile`
`createNestedBundleFile(String nestedDir, BundleFile bundleFile, BundleInfo.Generation generation, Collection<String> filterPrefixes)`
`static Storage`
`createStorage(org.eclipse.osgi.internal.framework.EquinoxContainer container)`
`static Enumeration<URL>`
`findEntries(List<BundleInfo.Generation> generations, String path, String filePattern, int options)`
`ModuleContainerAdaptor`
`getAdaptor()`
`ModuleRevisionBuilder`
`getBuilder(BundleInfo.Generation generation)`
`ModuleRevisionBuilder`
`getBuilder(BundleInfo.Generation generation, String extraCapabilities, String extraExports)`
`protected StorageManager`
`getChildStorageManager()`
`org.eclipse.osgi.internal.framework.EquinoxConfiguration`
`getConfiguration()`
`URLConnection`
`getContentConnection(Module module, String bundleLocation, InputStream in)`
`FrameworkExtensionInstaller`
`getExtensionInstaller()`
`File`
`getFile(String path, boolean checkParent)`
Gets a file from storage and conditionally checks the parent storage area if the file does not exist in the child configuration.
`File`
`getFile(String base, String path, boolean checkParent)`
Same as `getFile(String, boolean)` except takes a base parameter which is appended to the root storage area before looking for the path.
`org.eclipse.osgi.internal.log.EquinoxLogServices`
`getLogServices()`
`ModuleContainer`
`getModuleContainer()`
`ModuleDatabase`
`getModuleDatabase()`
`MRUBundleFileList`
`getMRUBundleFileList()`
`Version`
`getRuntimeVersion()`
`org.eclipse.osgi.internal.permadmin.SecurityAdmin`
`getSecurityAdmin()`
`BundleInfo.Generation`
`install(Module origin, String bundleLocation, InputStream toInstall)`
`boolean`
`isReadOnly()`
`static List<String>`
`listEntryPaths(List<BundleFile> bundleFiles, String path, String filePattern, int options)`
Returns the names of resources available from a list of bundle files.
`static String`
`sanitizeFilterInput(String filePattern)`
`void`
`save()`
`void`
`setPermissions(File file)`
Attempts to set the permissions of the file in a system dependent way.
`BundleInfo.Generation`
`update(Module module, InputStream updateIn)`
`BundleFile`
`wrapBundleFile(BundleFile bundleFile, BundleInfo.Generation generation, boolean isBase)`

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

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

## Field Details

### VERSION

public static final int VERSION

See Also:
  - Constant Field Values

### BUNDLE_DATA_DIR

public static final String BUNDLE_DATA_DIR

See Also:
  - Constant Field Values

### BUNDLE_FILE_NAME

public static final String BUNDLE_FILE_NAME

See Also:
  - Constant Field Values

### FRAMEWORK_INFO

public static final String FRAMEWORK_INFO

See Also:
  - Constant Field Values

### ECLIPSE_SYSTEMBUNDLE

public static final String ECLIPSE_SYSTEMBUNDLE

See Also:
  - Constant Field Values

### DELETE_FLAG

public static final String DELETE_FLAG

See Also:
  - Constant Field Values

### LIB_TEMP

public static final String LIB_TEMP

See Also:
  - Constant Field Values

## Method Details

### createStorage

public static Storage createStorage(org.eclipse.osgi.internal.framework.EquinoxContainer container) throws IOException, BundleException

Throws:
  `IOException`
  `BundleException`

### getRuntimeVersion

public Version getRuntimeVersion()

### getMRUBundleFileList

public MRUBundleFileList getMRUBundleFileList()

### close

public void close()

### getModuleDatabase

public ModuleDatabase getModuleDatabase()

### getAdaptor

public ModuleContainerAdaptor getAdaptor()

### getModuleContainer

public ModuleContainer getModuleContainer()

### getConfiguration

public org.eclipse.osgi.internal.framework.EquinoxConfiguration getConfiguration()

### getLogServices

public org.eclipse.osgi.internal.log.EquinoxLogServices getLogServices()

### getExtensionInstaller

public FrameworkExtensionInstaller getExtensionInstaller()

### isReadOnly

public boolean isReadOnly()

### getContentConnection

public URLConnection getContentConnection(Module module, String bundleLocation, InputStream in) throws BundleException

Throws:
  `BundleException`

### install

public BundleInfo.Generation install(Module origin, String bundleLocation, InputStream toInstall) throws BundleException

Throws:
  `BundleException`

### getBuilder

public ModuleRevisionBuilder getBuilder(BundleInfo.Generation generation) throws BundleException

Throws:
  `BundleException`

### getBuilder

public ModuleRevisionBuilder getBuilder(BundleInfo.Generation generation, String extraCapabilities, String extraExports) throws BundleException

Throws:
  `BundleException`

### update

public BundleInfo.Generation update(Module module, InputStream updateIn) throws BundleException

Throws:
  `BundleException`

### getFile

public File getFile(String path, boolean checkParent) throws Storage.StorageException
Gets a file from storage and conditionally checks the parent storage area if the file does not exist in the child configuration. Note, this method does not check for escaping of paths from the root storage area.

Parameters:
  `path` - the path relative to the root of the storage area
  `checkParent` - if true then check the parent storage (if any) when the file does not exist in the child storage area
Returns:
  the file being requested. A `null` value is never returned. The file returned may not exist.
Throws:
  `Storage.StorageException` - if there was an issue getting the file

### getFile

public File getFile(String base, String path, boolean checkParent) throws Storage.StorageException
Same as `getFile(String, boolean)` except takes a base parameter which is appended to the root storage area before looking for the path. If base is not null then additional checks are done to make sure the path does not escape out of the base path.

Parameters:
  `base` - the additional base path to append to the root storage area. May be `null`, in which case no check is done for escaping out of the base path.
  `path` - the path relative to the root + base storage area.
  `checkParent` - if true then check the parent storage (if any) when the file does not exist in the child storage area
Returns:
  the file being requested. A `null` value is never returned. The file returned may not exist.
Throws:
  `Storage.StorageException` - if there was an issue getting the file

### setPermissions

public void setPermissions(File file)
Attempts to set the permissions of the file in a system dependent way.

Parameters:
  `file` - the file to set the permissions on

### createBundleFile

public BundleFile createBundleFile(File content, BundleInfo.Generation generation, boolean isDirectory, boolean isBase)

### createNestedBundleFile

public BundleFile createNestedBundleFile(String nestedDir, BundleFile bundleFile, BundleInfo.Generation generation)

### createNestedBundleFile

public BundleFile createNestedBundleFile(String nestedDir, BundleFile bundleFile, BundleInfo.Generation generation, Collection<String> filterPrefixes)

### wrapBundleFile

public BundleFile wrapBundleFile(BundleFile bundleFile, BundleInfo.Generation generation, boolean isBase)

### compact

public void compact()

### save

public void save() throws IOException

Throws:
  `IOException`

### findEntries

public static Enumeration<URL> findEntries(List<BundleInfo.Generation> generations, String path, String filePattern, int options)

### listEntryPaths

public static List<String> listEntryPaths(List<BundleFile> bundleFiles, String path, String filePattern, int options)
Returns the names of resources available from a list of bundle files. No duplicate resource names are returned, each name is unique.

Parameters:
  `bundleFiles` - the list of bundle files to search in
  `path` - The path name in which to look.
  `filePattern` - The file name pattern for selecting resource names in the specified path.
  `options` - The options for listing resource names.
Returns:
  a list of resource names. If no resources are found then the empty list is returned.
See Also:
  - `BundleWiring.listResources(String, String, int)`

### sanitizeFilterInput

public static String sanitizeFilterInput(String filePattern) throws InvalidSyntaxException

Throws:
  `InvalidSyntaxException`

### copyToTempLibrary

public String copyToTempLibrary(BundleInfo.Generation generation, String absolutePath)

### getSecurityAdmin

public org.eclipse.osgi.internal.permadmin.SecurityAdmin getSecurityAdmin()

### getChildStorageManager

protected StorageManager getChildStorageManager() throws IOException

Throws:
  `IOException`