Interface AFile
-
- All Superinterfaces:
AAbstraction,AResource,java.lang.Comparable<AResource>
- All Known Implementing Classes:
EclipseFile,PlainJavaFile
public interface AFile extends AResource
A file is a resource in the file-system that contains data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.faktorips.devtools.abstraction.AResource
AResource.AResourceTreeTraversalDepth, AResource.AResourceType
-
-
Field Summary
-
Fields inherited from interface org.faktorips.devtools.abstraction.AResource
COMPARING_BY_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreate(java.io.InputStream source, org.eclipse.core.runtime.IProgressMonitor monitor)Creates this file in the file-system with data from the givenInputStream.java.io.InputStreamgetContents()Returns the file's data contents as anInputStream.java.lang.StringgetExtension()Returns the corresponding file's extension (the part after the last '.'), if there is any.booleanisReadOnly()Returns whether this file is read-only (meaning data can be read but not written).voidsetContents(java.io.InputStream source, boolean keepHistory, org.eclipse.core.runtime.IProgressMonitor monitor)Overwrites this file in the file-system with data from the givenInputStream.-
Methods inherited from interface org.faktorips.devtools.abstraction.AAbstraction
unwrap
-
Methods inherited from interface org.faktorips.devtools.abstraction.AResource
compareTo, copy, createMarker, delete, deleteMarkers, exists, findMarkers, getLocalTimeStamp, getLocation, getModificationStamp, getName, getParent, getProject, getProjectRelativePath, getType, getWorkspace, getWorkspaceRelativePath, isAccessible, isDerived, isSynchronized, move, refreshLocal, setDerived, touch
-
-
-
-
Method Detail
-
getExtension
java.lang.String getExtension()
Returns the corresponding file's extension (the part after the last '.'), if there is any.- Returns:
- this file's extension or an empty String if the file has no extension
-
isReadOnly
boolean isReadOnly()
Returns whether this file is read-only (meaning data can be read but not written).- Returns:
- whether this file is read-only
-
create
void create(java.io.InputStream source, org.eclipse.core.runtime.IProgressMonitor monitor)Creates this file in the file-system with data from the givenInputStream.- Parameters:
source- provides the data to be written to the new filemonitor- a progress monitor that is notified about this process. The monitor may benullwhen progress does not need to be reported.- Throws:
IpsException- if the file already exists or creation fails
-
getContents
java.io.InputStream getContents()
Returns the file's data contents as anInputStream.- Returns:
- the file's contents
- Throws:
IpsException- if the file can't be read
-
setContents
void setContents(java.io.InputStream source, boolean keepHistory, org.eclipse.core.runtime.IProgressMonitor monitor)Overwrites this file in the file-system with data from the givenInputStream.- Parameters:
source- provides the data to be written to the new filekeepHistory- whether to keep a history of the content (if supported by the workspace)monitor- a progress monitor that is notified about this process. The monitor may benullwhen progress does not need to be reported.- Throws:
IpsException- if the file can't be written or does not exist
-
-