Package org.eclipse.osgi.storage
Class Storage
java.lang.Object
org.eclipse.osgi.storage.Storage
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
compact()
copyToTempLibrary
(BundleInfo.Generation generation, String absolutePath) createBundleFile
(File content, BundleInfo.Generation generation, boolean isDirectory, boolean isBase) createNestedBundleFile
(String nestedDir, BundleFile bundleFile, BundleInfo.Generation generation) 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) getBuilder
(BundleInfo.Generation generation) getBuilder
(BundleInfo.Generation generation, String extraCapabilities, String extraExports) protected StorageManager
org.eclipse.osgi.internal.framework.EquinoxConfiguration
getContentConnection
(Module module, String bundleLocation, InputStream in) Gets a file from storage and conditionally checks the parent storage area if the file does not exist in the child configuration.Same asgetFile(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
org.eclipse.osgi.internal.permadmin.SecurityAdmin
install
(Module origin, String bundleLocation, InputStream toInstall) boolean
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.update
(Module module, InputStream updateIn) wrapBundleFile
(BundleFile bundleFile, BundleInfo.Generation generation, boolean isBase)
-
Field Details
-
VERSION
public static final int VERSION- See Also:
-
BUNDLE_DATA_DIR
- See Also:
-
BUNDLE_FILE_NAME
- See Also:
-
FRAMEWORK_INFO
- See Also:
-
ECLIPSE_SYSTEMBUNDLE
- See Also:
-
DELETE_FLAG
- See Also:
-
LIB_TEMP
- See Also:
-
-
Method Details
-
createStorage
public static Storage createStorage(org.eclipse.osgi.internal.framework.EquinoxContainer container) throws IOException, BundleException - Throws:
IOException
BundleException
-
getRuntimeVersion
-
getMRUBundleFileList
-
close
public void close() -
getModuleDatabase
-
getAdaptor
-
getModuleContainer
-
getConfiguration
public org.eclipse.osgi.internal.framework.EquinoxConfiguration getConfiguration() -
getLogServices
public org.eclipse.osgi.internal.log.EquinoxLogServices getLogServices() -
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
- Throws:
BundleException
-
getBuilder
public ModuleRevisionBuilder getBuilder(BundleInfo.Generation generation, String extraCapabilities, String extraExports) throws BundleException - Throws:
BundleException
-
update
- Throws:
BundleException
-
getFile
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 areacheckParent
- 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
Same asgetFile(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 benull
, 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
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
- 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 inpath
- 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:
-
sanitizeFilterInput
- Throws:
InvalidSyntaxException
-
copyToTempLibrary
-
getSecurityAdmin
public org.eclipse.osgi.internal.permadmin.SecurityAdmin getSecurityAdmin() -
getChildStorageManager
- Throws:
IOException
-