public class EclipseResourceFileSystemAccess2 extends AbstractFileSystemAccess2
Modifier and Type | Class and Description |
---|---|
static interface |
EclipseResourceFileSystemAccess2.IFileCallback |
DEFAULT_OUTPUT
Constructor and Description |
---|
EclipseResourceFileSystemAccess2() |
Modifier and Type | Method and Description |
---|---|
protected void |
createContainer(org.eclipse.core.resources.IContainer container) |
protected void |
createFolder(org.eclipse.core.resources.IFolder folder)
Deprecated.
use
createContainer(IContainer) instead |
void |
deleteFile(org.eclipse.core.resources.IFile file,
org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
deleteFile(org.eclipse.core.resources.IFile file,
java.lang.String outputName,
org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
deleteFile(java.lang.String fileName,
java.lang.String outputName) |
protected void |
ensureExists(org.eclipse.core.resources.IContainer container) |
protected boolean |
ensureOutputConfigurationDirectoryExists(OutputConfiguration outputConfig) |
protected void |
ensureParentExists(org.eclipse.core.resources.IFile file) |
void |
flushSourceTraces()
Can be used to announce that a builder participant is done with this file system access and all potentially
recorded trace information should be persisted.
|
void |
flushSourceTraces(java.lang.String generatorName)
Can be used to announce that a builder participant is done with this file system access and all potentially
recorded trace information should be persisted.
|
protected void |
generateFile(org.eclipse.core.resources.IFile file,
java.io.InputStream content,
org.eclipse.core.resources.IFile traceFile,
java.lang.CharSequence traceContent,
OutputConfiguration outputConfig) |
void |
generateFile(java.lang.String fileName,
java.lang.String outputName,
java.lang.CharSequence contents) |
void |
generateFile(java.lang.String fileName,
java.lang.String outputName,
java.io.InputStream content)
Writes binary data to disk.
|
protected EclipseResourceFileSystemAccess2.IFileCallback |
getCallBack() |
protected org.eclipse.core.resources.IContainer |
getContainer(OutputConfiguration outputConfig) |
protected java.lang.String |
getEncoding(org.eclipse.core.resources.IFile file) |
protected org.eclipse.core.resources.IFile |
getFile(java.lang.String fileName,
java.lang.String outputName) |
protected org.eclipse.core.resources.IFile |
getFile(java.lang.String fileName,
java.lang.String outputName,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
protected org.eclipse.core.resources.IFolder |
getFolder(OutputConfiguration outputConfig)
Deprecated.
use
getContainer(OutputConfiguration) instead |
protected StringInputStream |
getInputStream(java.lang.String contentsAsString,
java.lang.String encoding) |
protected org.eclipse.core.runtime.IProgressMonitor |
getMonitor() |
protected org.eclipse.core.resources.IProject |
getProject() |
protected org.eclipse.core.resources.IProject |
getProjectContext(org.eclipse.emf.ecore.resource.Resource resource) |
protected org.eclipse.core.resources.IFile |
getSmapFile(org.eclipse.core.resources.IFile javaSourceFile)
Deprecated.
|
protected com.google.common.collect.Multimap<SourceRelativeURI,org.eclipse.core.runtime.IPath> |
getSourceTraces() |
protected org.eclipse.core.resources.IFile |
getTraceFile(org.eclipse.core.resources.IFile file) |
protected TraceMarkers |
getTraceMarkers() |
org.eclipse.emf.common.util.URI |
getURI(java.lang.String path,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
org.eclipse.emf.common.util.URI |
getURI(java.lang.String path,
java.lang.String outputConfiguration)
We cannot use the storage to URI mapper here, as it only works for Xtext based languages
|
org.eclipse.emf.common.util.URI |
getURI(java.lang.String path,
java.lang.String outputName,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
protected boolean |
hasContentsChanged(org.eclipse.core.resources.IFile file,
java.io.InputStream newContent) |
protected boolean |
hasContentsChanged(org.eclipse.core.resources.IFile file,
StringInputStream newContent) |
boolean |
isFile(java.lang.String path)
Tests whether the file exists at the location in the default output configuration.
|
boolean |
isFile(java.lang.String path,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
boolean |
isFile(java.lang.String path,
java.lang.String outputConfigurationName)
Tests whether the file exists at the location denoted by the output configuration.
|
boolean |
isFile(java.lang.String path,
java.lang.String outputConfigurationName,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
protected boolean |
isTraceFile(org.eclipse.core.resources.IFile file) |
java.io.InputStream |
readBinaryFile(java.lang.String fileName,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
java.io.InputStream |
readBinaryFile(java.lang.String fileName,
java.lang.String outputCfgName)
Creates an InputStream to read a binary file from disk.
|
java.io.InputStream |
readBinaryFile(java.lang.String fileName,
java.lang.String outputCfgName,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
java.lang.CharSequence |
readTextFile(java.lang.String fileName,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
java.lang.CharSequence |
readTextFile(java.lang.String fileName,
java.lang.String outputCfgName)
Reads a text file from disk.
|
java.lang.CharSequence |
readTextFile(java.lang.String fileName,
java.lang.String outputCfgName,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
protected void |
resetSourceTraces() |
void |
setContext(java.lang.Object context)
Sets the context to further configure this file system access instance.
|
protected void |
setDerived(org.eclipse.core.resources.IFile file,
boolean derived) |
void |
setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
setPostProcessor(EclipseResourceFileSystemAccess2.IFileCallback callBack) |
void |
setProject(org.eclipse.core.resources.IProject project) |
protected void |
updateTraceInformation(org.eclipse.core.resources.IFile traceFile,
java.lang.CharSequence contents,
boolean derived) |
generateFile, readBinaryFile, readTextFile
deleteFile, generateFile, getCurrentSource, getOutputConfig, getOutputConfigurations, getPathes, getURI, postProcess, postProcess, setCurrentSource, setOutputConfigurations, setOutputPath, setOutputPath
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteFile, generateFile
getURI
protected com.google.common.collect.Multimap<SourceRelativeURI,org.eclipse.core.runtime.IPath> getSourceTraces()
protected void resetSourceTraces()
protected TraceMarkers getTraceMarkers()
protected EclipseResourceFileSystemAccess2.IFileCallback getCallBack()
public void setProject(org.eclipse.core.resources.IProject project)
public void setContext(java.lang.Object context)
AbstractFileSystemAccess2
setContext
in class AbstractFileSystemAccess2
context
- a context from which project configuration can be obtained. Supported context types
depend on the concrete implementation, but Resource
is usually a good fit.protected org.eclipse.core.resources.IProject getProjectContext(org.eclipse.emf.ecore.resource.Resource resource)
protected org.eclipse.core.resources.IProject getProject()
public void setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)
public void setPostProcessor(EclipseResourceFileSystemAccess2.IFileCallback callBack)
protected org.eclipse.core.runtime.IProgressMonitor getMonitor()
protected boolean ensureOutputConfigurationDirectoryExists(OutputConfiguration outputConfig)
public void generateFile(java.lang.String fileName, java.lang.String outputName, java.lang.CharSequence contents)
fileName
- using '/' as file separatoroutputName
- the name of the output configurationcontents
- the to-be-written contents.public void generateFile(java.lang.String fileName, java.lang.String outputName, java.io.InputStream content)
IFileSystemAccessExtension3
IFileSystemAccess.generateFile(String, String, CharSequence)
protected void generateFile(org.eclipse.core.resources.IFile file, java.io.InputStream content, org.eclipse.core.resources.IFile traceFile, java.lang.CharSequence traceContent, OutputConfiguration outputConfig)
protected java.lang.String getEncoding(org.eclipse.core.resources.IFile file) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected void setDerived(org.eclipse.core.resources.IFile file, boolean derived) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
@Deprecated protected void createFolder(org.eclipse.core.resources.IFolder folder) throws org.eclipse.core.runtime.CoreException
createContainer(IContainer)
insteadorg.eclipse.core.runtime.CoreException
protected void createContainer(org.eclipse.core.resources.IContainer container) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected void ensureParentExists(org.eclipse.core.resources.IFile file) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected void ensureExists(org.eclipse.core.resources.IContainer container) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected StringInputStream getInputStream(java.lang.String contentsAsString, java.lang.String encoding)
@Deprecated protected org.eclipse.core.resources.IFolder getFolder(OutputConfiguration outputConfig)
getContainer(OutputConfiguration)
insteadprotected org.eclipse.core.resources.IContainer getContainer(OutputConfiguration outputConfig)
protected boolean hasContentsChanged(org.eclipse.core.resources.IFile file, StringInputStream newContent)
protected boolean hasContentsChanged(org.eclipse.core.resources.IFile file, java.io.InputStream newContent)
protected void updateTraceInformation(org.eclipse.core.resources.IFile traceFile, java.lang.CharSequence contents, boolean derived) throws org.eclipse.core.runtime.CoreException, java.io.IOException
org.eclipse.core.runtime.CoreException
- if something unexpected happens during resource accessjava.io.IOException
- if serialization of the trace data fails@Deprecated protected org.eclipse.core.resources.IFile getSmapFile(org.eclipse.core.resources.IFile javaSourceFile)
public void flushSourceTraces() throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
TraceMarkers.DEFAULT_GENERATOR_NAME
public void flushSourceTraces(java.lang.String generatorName) throws org.eclipse.core.runtime.CoreException
generatorName
- the name of the generator.org.eclipse.core.runtime.CoreException
protected boolean isTraceFile(org.eclipse.core.resources.IFile file)
protected org.eclipse.core.resources.IFile getTraceFile(org.eclipse.core.resources.IFile file)
public void deleteFile(java.lang.String fileName, java.lang.String outputName)
deleteFile
in interface IFileSystemAccessExtension
deleteFile
in class AbstractFileSystemAccess
fileName
- using '/' as file separatoroutputName
- the name of the output configurationpublic void deleteFile(org.eclipse.core.resources.IFile file, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public void deleteFile(org.eclipse.core.resources.IFile file, java.lang.String outputName, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected org.eclipse.core.resources.IFile getFile(java.lang.String fileName, java.lang.String outputName)
protected org.eclipse.core.resources.IFile getFile(java.lang.String fileName, java.lang.String outputName, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
public org.eclipse.emf.common.util.URI getURI(java.lang.String path, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
public org.eclipse.emf.common.util.URI getURI(java.lang.String path, java.lang.String outputConfiguration)
public org.eclipse.emf.common.util.URI getURI(java.lang.String path, java.lang.String outputName, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
public java.io.InputStream readBinaryFile(java.lang.String fileName, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
public java.io.InputStream readBinaryFile(java.lang.String fileName, java.lang.String outputCfgName) throws RuntimeIOException
IFileSystemAccessExtension3
IFileSystemAccessExtension3.readTextFile(String, String)
.RuntimeIOException
public java.io.InputStream readBinaryFile(java.lang.String fileName, java.lang.String outputCfgName, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws RuntimeIOException
RuntimeIOException
public java.lang.CharSequence readTextFile(java.lang.String fileName, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
public java.lang.CharSequence readTextFile(java.lang.String fileName, java.lang.String outputCfgName) throws RuntimeIOException
IFileSystemAccessExtension3
IFileSystemAccessExtension3.readBinaryFile(String, String)
.RuntimeIOException
public java.lang.CharSequence readTextFile(java.lang.String fileName, java.lang.String outputCfgName, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws RuntimeIOException
RuntimeIOException
public boolean isFile(java.lang.String path, java.lang.String outputConfigurationName) throws RuntimeIOException
IFileSystemAccess2
true
if the file at the described location exists and is a normal file
(not a directory). Otherwise false
.isFile
in interface IFileSystemAccess2
isFile
in class AbstractFileSystemAccess2
path
- using '/' as path separatoroutputConfigurationName
- the name of the output configurationtrue
when the file at the given path exists and is a normal file. Will return false
when
the path belongs to a directory.RuntimeIOException
public boolean isFile(java.lang.String path) throws RuntimeIOException
IFileSystemAccess2
true
if the file at the described location exists and is a normal file
(not a directory). Otherwise false
.isFile
in interface IFileSystemAccess2
isFile
in class AbstractFileSystemAccess2
path
- using '/' as path separatortrue
when the file at the given path exists and is a normal file. Will return false
when
the path belongs to a directory.RuntimeIOException
public boolean isFile(java.lang.String path, java.lang.String outputConfigurationName, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
public boolean isFile(java.lang.String path, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws RuntimeIOException
RuntimeIOException