public class EclipseFileSystemSupportImpl extends AbstractFileSystemSupport
Constructor and Description |
---|
EclipseFileSystemSupportImpl() |
Modifier and Type | Method and Description |
---|---|
void |
delete(Path path)
Deletes the file or folder the given path points to.
|
boolean |
exists(Path path) |
protected org.eclipse.core.resources.IResource |
findResource(Path path) |
java.lang.String |
getCharset(Path path)
Returns the name of a charset to be used when decoding the contents of this
file into characters.
|
java.lang.Iterable<? extends Path> |
getChildren(Path path) |
java.io.InputStream |
getContentsAsStream(Path path)
Returns an open input stream on the contents of this file.
|
protected org.eclipse.core.resources.IContainer |
getEclipseContainer(Path path) |
protected org.eclipse.core.resources.IFile |
getEclipseFile(Path path) |
protected org.eclipse.core.resources.IFolder |
getEclipseFolder(Path path) |
long |
getLastModification(Path path) |
Path |
getPath(org.eclipse.emf.ecore.resource.Resource res) |
org.eclipse.core.resources.IWorkspaceRoot |
getWorkspaceRoot() |
boolean |
isFile(Path path) |
boolean |
isFolder(Path path) |
void |
mkdir(Path path)
Creates a directory for the given path and all its parents if necessary.
|
void |
setContentsAsStream(Path path,
java.io.InputStream stream)
Sets the contents of this file to the bytes in the given input stream.
|
void |
setWorkspaceRoot(org.eclipse.core.resources.IWorkspaceRoot workspaceRoot) |
protected org.eclipse.core.runtime.Path |
toEclipsePath(Path path) |
java.net.URI |
toURI(Path path)
Returns the URI representing the given path.
|
protected java.net.URI |
toURI(Path path,
java.util.List<java.lang.String> trailingSegments) |
getContents, getEncodingProvider, getPostProcessor, setContents, setEncodingProvider, setPostProcessor
protected org.eclipse.core.resources.IFile getEclipseFile(Path path)
protected org.eclipse.core.resources.IFolder getEclipseFolder(Path path)
protected org.eclipse.core.resources.IContainer getEclipseContainer(Path path)
protected org.eclipse.core.resources.IResource findResource(Path path)
protected org.eclipse.core.runtime.Path toEclipsePath(Path path)
public java.lang.Iterable<? extends Path> getChildren(Path path)
public boolean exists(Path path)
path
- the pathpublic boolean isFolder(Path path)
public boolean isFile(Path path)
public long getLastModification(Path path)
long
value representing the time the file was
last modified, measured in milliseconds since the epoch
(00:00:00 GMT, January 1, 1970), or 0L
if the
file does not exist.public java.lang.String getCharset(Path path)
FileSystemSupport
path
- the pathpublic java.io.InputStream getContentsAsStream(Path path)
FileSystemSupport
path
- the pathpublic void delete(Path path)
MutableFileSystemSupport
public void mkdir(Path path)
MutableFileSystemSupport
path
- the path to the filepublic void setContentsAsStream(Path path, java.io.InputStream stream)
MutableFileSystemSupport
path
- the path to the filestream
- an input stream containing the new contents of the filepublic java.net.URI toURI(Path path)
FileSystemSupport
Warning: Don't use this method to get write access.
path
- the pathprotected java.net.URI toURI(Path path, java.util.List<java.lang.String> trailingSegments)
public Path getPath(org.eclipse.emf.ecore.resource.Resource res)
getPath
in class AbstractFileSystemSupport
@Pure public org.eclipse.core.resources.IWorkspaceRoot getWorkspaceRoot()
public void setWorkspaceRoot(org.eclipse.core.resources.IWorkspaceRoot workspaceRoot)