public class VFS2SnapshotPath extends Object implements org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
Constructor and Description |
---|
VFS2SnapshotPath(org.apache.commons.vfs2.impl.StandardFileSystemManager manager,
org.apache.commons.vfs2.FileObject fileObject)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(Path srcFile)
Copies file from local destination with two phase copy pattern.
|
boolean |
createDirectories()
Creates directories.
|
void |
createNewFile()
Creates new file.
|
boolean |
delete()
Deletes file.
|
void |
deleteIfEmpty()
Deletes file/folder if empty.
|
boolean |
exists()
Checks that file exists.
|
String |
getAbsolutePath()
Gets absolute path.
|
Collection<org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath> |
getEntries()
Gets files and folders in this folder.
|
String |
getName()
Gets file name.
|
org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath |
getParent()
Gets parent.
|
InputStream |
inputStream()
Opens input stream for this file.
|
boolean |
isDirectory()
Checks that this is a folder.
|
boolean |
isEmptyDirectory()
Checks that directory is empty.
|
boolean |
isFile()
Checks that this is a file.
|
long |
length()
Gets file length.
|
OutputStream |
outputStream()
Opens output stream for this file.
|
org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath |
resolve(String name)
Resolves subfile.
|
@Nullable org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath |
resolveRegularOrCompressed(String name)
Resolves regular or compressed file (zip, zstd, lz4, etc).
|
org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath |
resolveSibling(String fileName)
Resolves file in parent folder.
|
void |
sync()
Tries to sync this file.
|
String |
toString() |
public VFS2SnapshotPath(org.apache.commons.vfs2.impl.StandardFileSystemManager manager, org.apache.commons.vfs2.FileObject fileObject)
public long length()
length
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public boolean exists()
exists
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public boolean delete()
delete
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
true
if and only if the file or directory is successfully deleted,
false
otherwise.public void deleteIfEmpty()
deleteIfEmpty
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public void createNewFile()
createNewFile
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath getParent()
getParent
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public boolean createDirectories()
createDirectories
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
true
if createdpublic org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath resolve(String name)
resolve
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
name
- Subfile name.@Nullable public @Nullable org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath resolveRegularOrCompressed(String name)
resolveRegularOrCompressed
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
name
- File name.public boolean isFile()
isFile
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
true
only if it is a file.public boolean isDirectory()
isDirectory
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
true
only if it is a folder.public boolean isEmptyDirectory()
isEmptyDirectory
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
true
only if this is directory and it is empty.public org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath resolveSibling(String fileName)
resolveSibling
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
fileName
- File name.public OutputStream outputStream()
outputStream
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public InputStream inputStream()
inputStream
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public String getName()
getName
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public String getAbsolutePath()
getAbsolutePath
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public Collection<org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath> getEntries()
getEntries
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public void sync()
sync
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
public void copyFrom(Path srcFile) throws IOException
copyFrom
in interface org.gridgain.grid.internal.processors.cache.database.snapshot.file.SnapshotPath
srcFile
- Local file location.IOException
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024