@ApplicationScoped public class VFSRegistryHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VFSRegistryHelper.BySuffixFilter
Helper class for filtering files by a suffix.
|
| Modifier and Type | Field and Description |
|---|---|
protected static String |
PROVISIONING_BRANCH |
protected static String |
PROVISIONING_PATH |
| Constructor and Description |
|---|
VFSRegistryHelper() |
VFSRegistryHelper(VFSMarshallerRegistry marshallerRegistry,
org.uberfire.io.IOService ioService,
org.uberfire.java.nio.file.FileSystem fileSystem) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteBatch(org.uberfire.java.nio.file.Path path)
Deletes a path by performing a batch delete operation.
|
org.uberfire.java.nio.file.Path |
ensureDirectory(String directory)
Ensure that an expected directory under the VFS registries host directory exists.
|
protected void |
init() |
String |
md5Hex(String content)
Helper method calculating the MD5 digest for a String.
|
List<Object> |
readEntries(org.uberfire.java.nio.file.Path rootPath,
org.uberfire.java.nio.file.DirectoryStream.Filter<org.uberfire.java.nio.file.Path> filter)
Reads a list of entries from a path by filtering the files by a given filter.
|
Object |
readEntry(org.uberfire.java.nio.file.Path path)
Reads an Object previously marshalled and stored as a VFSRegistryEntry in a given path.
|
void |
storeEntry(org.uberfire.java.nio.file.Path path,
Object value)
Stores an Object marshalled value as a VFSRegistryEntry in the target path.
|
void |
writeBatch(org.uberfire.java.nio.file.Path path,
String content)
Writes a content on a target path by performing a batch delete operation.
|
protected static final String PROVISIONING_BRANCH
protected static final String PROVISIONING_PATH
public VFSRegistryHelper()
@Inject public VFSRegistryHelper(VFSMarshallerRegistry marshallerRegistry, @Named(value="ioStrategy") org.uberfire.io.IOService ioService, @Named(value="systemFS") org.uberfire.java.nio.file.FileSystem fileSystem)
@PostConstruct protected void init()
public org.uberfire.java.nio.file.Path ensureDirectory(String directory)
directory - a directory name.public String md5Hex(String content)
content - a String value for calculating the digest.public void storeEntry(org.uberfire.java.nio.file.Path path,
Object value)
throws Exception
path - a path for storing the generated VFSRegistryEntry.value - an object value to marshall and store.Exception - exceptions might be thrown in cases of filesystem or marshalling errors.public Object readEntry(org.uberfire.java.nio.file.Path path) throws Exception
path - the path where the VFSRegistryEntry is stored.Exception - exceptions might be thrown in cases of filesystem or marshalling errors.public List<Object> readEntries(org.uberfire.java.nio.file.Path rootPath, org.uberfire.java.nio.file.DirectoryStream.Filter<org.uberfire.java.nio.file.Path> filter) throws Exception
rootPath - a path for looking of the VFSRegistryEntry files.filter - a filter for selecting the files.Exceptionpublic void writeBatch(org.uberfire.java.nio.file.Path path,
String content)
path - a path to write.content - a content to write.public void deleteBatch(org.uberfire.java.nio.file.Path path)
path - a path to delete.Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.