public abstract class ArchiveFileSystem extends NewVirtualFileSystem
DEFAULT_LENGTH, DEFAULT_TIMESTAMP| Constructor and Description |
|---|
ArchiveFileSystem() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.String |
composeRootPath(java.lang.String localPath)
A reverse to
extractLocalPath(String) - i.e. |
byte [] |
contentsToByteArray(VirtualFile file) |
VirtualFile |
copyFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent,
java.lang.String copyName)
Implementation of copying files in this file system
|
VirtualFile |
createChildDirectory(java.lang.Object requestor,
VirtualFile parent,
java.lang.String dir)
Implementation of adding directories in this file system
|
VirtualFile |
createChildFile(java.lang.Object requestor,
VirtualFile parent,
java.lang.String file)
Implementation of adding files in this file system
|
void |
deleteFile(java.lang.Object requestor,
VirtualFile file)
Implementation of deleting files in this file system
|
boolean |
exists(VirtualFile file) |
protected abstract java.lang.String |
extractLocalPath(java.lang.String rootPath)
Strips any separator chars from a root (obtained via
VfsUtilCore.getRootFile(com.intellij.openapi.vfs.VirtualFile) path to obtain a path to a local file. |
VirtualFile |
findLocalByRootPath(java.lang.String rootPath)
Returns a local file of an archive which hosts a root with the given path
(i.e.: "jar:///path/to/jar.jar!/" => file:///path/to/jar.jar),
or
null if the local file is of incorrect type. |
FileAttributes |
getAttributes(VirtualFile file)
Reads various file attributes in one shot (to reduce the number of native I/O calls).
|
protected abstract ArchiveHandler |
getHandler(VirtualFile entryFile) |
java.io.InputStream |
getInputStream(VirtualFile file)
Does NOT strip the BOM from the beginning of the stream, unlike the
VirtualFile.getInputStream() |
long |
getLength(VirtualFile file) |
VirtualFile |
getLocalByEntry(VirtualFile entry)
Returns a local file of an archive which hosts a given entry file
(i.e.: jar:///path/to/jar.jar!/resource.xml => file:///path/to/jar.jar),
or
null if the file does not belong to this file system. |
java.io.OutputStream |
getOutputStream(VirtualFile file,
java.lang.Object requestor,
long modStamp,
long timeStamp)
Does NOT add the BOM to the beginning of the stream, unlike the
VirtualFile.getOutputStream(Object) |
int |
getRank() |
protected java.lang.String |
getRelativePath(VirtualFile file) |
VirtualFile |
getRootByEntry(VirtualFile entry)
Returns a root entry of an archive which hosts a given entry file
(i.e.: jar:///path/to/jar.jar!/resource.xml => jar:///path/to/jar.jar!/),
or
null if the file does not belong to this file system. |
VirtualFile |
getRootByLocal(VirtualFile file)
Returns a root entry of an archive hosted by a given local file
(i.e.: file:///path/to/jar.jar => jar:///path/to/jar.jar!/),
or
null if the file does not host this file system. |
java.lang.String |
getRootPathByLocal(VirtualFile file) |
long |
getTimeStamp(VirtualFile file) |
protected boolean |
isCorrectFileType(VirtualFile local)
Implementations should return
false if the given file may not host this file system. |
boolean |
isDirectory(VirtualFile file) |
boolean |
isWritable(VirtualFile file) |
java.lang.String [] |
list(VirtualFile file) |
void |
moveFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent)
Implementation of moving files in this file system
|
void |
renameFile(java.lang.Object requestor,
VirtualFile file,
java.lang.String newName)
Implementation of renaming files in this file system
|
void |
setTimeStamp(VirtualFile file,
long timeStamp) |
void |
setWritable(VirtualFile file,
boolean writableFlag) |
addVirtualFileListener, extractRootPath, findFileByPathIfCached, getCanonicallyCasedName, hasChildren, isReadOnly, isSymLink, markNewFilesAsDirty, normalize, refreshWithoutFileWatcher, removeVirtualFileListener, resolveSymLinkextractPresentableUrl, findFileByPath, getProtocol, isCaseSensitive, isValidName, refresh, refreshAndFindFileByPathpublic VirtualFile getRootByLocal(VirtualFile file)
null if the file does not host this file system.public java.lang.String getRootPathByLocal(VirtualFile file)
public VirtualFile getRootByEntry(VirtualFile entry)
null if the file does not belong to this file system.public VirtualFile getLocalByEntry(VirtualFile entry)
null if the file does not belong to this file system.protected abstract java.lang.String extractLocalPath(java.lang.String rootPath)
VfsUtilCore.getRootFile(com.intellij.openapi.vfs.VirtualFile) path to obtain a path to a local file.protected abstract java.lang.String composeRootPath(java.lang.String localPath)
extractLocalPath(String) - i.e. dresses a local file path to make it a suitable root path for this filesystem.
E.g. "/x/y.jar" -> "/x/y.jar!/"protected abstract ArchiveHandler getHandler(VirtualFile entryFile)
public int getRank()
getRank in class NewVirtualFileSystempublic VirtualFile copyFile(java.lang.Object requestor, VirtualFile file, VirtualFile newParent, java.lang.String copyName) throws java.io.IOException
VirtualFileSystemcopyFile in interface FileSystemInterfacecopyFile in class NewVirtualFileSystemjava.io.IOExceptionVirtualFile.copy(Object,VirtualFile,String)public VirtualFile createChildDirectory(java.lang.Object requestor, VirtualFile parent, java.lang.String dir) throws java.io.IOException
VirtualFileSystemcreateChildDirectory in interface FileSystemInterfacecreateChildDirectory in class NewVirtualFileSystemjava.io.IOExceptionVirtualFile.createChildDirectory(Object,String)public VirtualFile createChildFile(java.lang.Object requestor, VirtualFile parent, java.lang.String file) throws java.io.IOException
VirtualFileSystemcreateChildFile in interface FileSystemInterfacecreateChildFile in class NewVirtualFileSystemjava.io.IOExceptionVirtualFile.createChildData(Object,String)public void deleteFile(java.lang.Object requestor,
VirtualFile file)
throws java.io.IOException
VirtualFileSystemdeleteFile in interface FileSystemInterfacedeleteFile in class NewVirtualFileSystemjava.io.IOExceptionVirtualFile.delete(Object)public void moveFile(java.lang.Object requestor,
VirtualFile file,
VirtualFile newParent)
throws java.io.IOException
VirtualFileSystemmoveFile in interface FileSystemInterfacemoveFile in class NewVirtualFileSystemjava.io.IOExceptionVirtualFile.move(Object,VirtualFile)public void renameFile(java.lang.Object requestor,
VirtualFile file,
java.lang.String newName)
throws java.io.IOException
VirtualFileSystemrenameFile in interface FileSystemInterfacerenameFile in class NewVirtualFileSystemjava.io.IOExceptionVirtualFile.rename(Object,String)protected java.lang.String getRelativePath(VirtualFile file)
public FileAttributes getAttributes(VirtualFile file)
NewVirtualFileSystemgetAttributes in class NewVirtualFileSystemfile - file to get attributes of.null if the file doesn't exist.public java.lang.String [] list(VirtualFile file)
public boolean exists(VirtualFile file)
public boolean isDirectory(VirtualFile file)
public boolean isWritable(VirtualFile file)
public long getTimeStamp(VirtualFile file)
public long getLength(VirtualFile file)
public byte [] contentsToByteArray(VirtualFile file) throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream getInputStream(VirtualFile file) throws java.io.IOException
FileSystemInterfaceVirtualFile.getInputStream()java.io.IOExceptionpublic void setTimeStamp(VirtualFile file, long timeStamp) throws java.io.IOException
java.io.IOExceptionpublic void setWritable(VirtualFile file, boolean writableFlag) throws java.io.IOException
java.io.IOExceptionpublic java.io.OutputStream getOutputStream(VirtualFile file, java.lang.Object requestor, long modStamp, long timeStamp) throws java.io.IOException
FileSystemInterfaceVirtualFile.getOutputStream(Object)java.io.IOExceptionpublic VirtualFile findLocalByRootPath(java.lang.String rootPath)
null if the local file is of incorrect type.protected boolean isCorrectFileType(VirtualFile local)
false if the given file may not host this file system.