Package manifold.api.fs.def
Class FileFragmentImpl
- java.lang.Object
-
- manifold.api.fs.def.FileFragmentImpl
-
- All Implemented Interfaces:
IFile,IFileFragment,IResource
public class FileFragmentImpl extends Object implements IFileFragment
-
-
Field Summary
-
Fields inherited from interface manifold.api.fs.IFile
EMPTY_ARRAY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreate()booleandelete()booleanequals(Object o)booleanexists()Indicates whether this resource exists.StringgetBaseName()ObjectgetContainer()The file element hosting the fragment e.g., a comment or string literalStringgetContent()IFilegetEnclosingFile()StringgetExtension()IFileSystemgetFileSystem()The file system supporting this resourceHostKindgetHostKind()intgetLength()StringgetName()Gets this file's or directory's name.intgetOffset()IDirectorygetParent()Gets this file's our directory's parent directory.ResourcePathgetPath()StringgetScope()inthashCode()booleanisChildOf(IDirectory dir)Indicates whether this resource is a direct child of the given directory.booleanisDescendantOf(IDirectory dir)Indicates whether this resource is a descendant of the given directory.booleanisInJar()booleanisJavaFile()InputStreamopenInputStream()OutputStreamopenOutputStream()OutputStreamopenOutputStreamForAppend()voidsetContainer(Object container)voidsetOffset(Supplier<Integer> offset)FiletoJavaFile()URItoURI()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface manifold.api.fs.IFileFragment
getPhysicalFile
-
-
-
-
Method Detail
-
getScope
public String getScope()
- Specified by:
getScopein interfaceIFileFragment
-
getContent
public String getContent()
-
getContainer
public Object getContainer()
Description copied from interface:IFileFragmentThe file element hosting the fragment e.g., a comment or string literal- Specified by:
getContainerin interfaceIFileFragment
-
setContainer
public void setContainer(Object container)
- Specified by:
setContainerin interfaceIFileFragment
-
getHostKind
public HostKind getHostKind()
- Specified by:
getHostKindin interfaceIFileFragment
-
getEnclosingFile
public IFile getEnclosingFile()
- Specified by:
getEnclosingFilein interfaceIFileFragment
-
getOffset
public int getOffset()
- Specified by:
getOffsetin interfaceIFileFragment
-
setOffset
public void setOffset(Supplier<Integer> offset)
- Specified by:
setOffsetin interfaceIFileFragment
-
getLength
public int getLength()
- Specified by:
getLengthin interfaceIFileFragment
-
openInputStream
public InputStream openInputStream()
- Specified by:
openInputStreamin interfaceIFile
-
openOutputStream
public OutputStream openOutputStream()
- Specified by:
openOutputStreamin interfaceIFile
-
openOutputStreamForAppend
public OutputStream openOutputStreamForAppend()
- Specified by:
openOutputStreamForAppendin interfaceIFile
-
getExtension
public String getExtension()
- Specified by:
getExtensionin interfaceIFile
-
getBaseName
public String getBaseName()
- Specified by:
getBaseNamein interfaceIFile
-
getFileSystem
public IFileSystem getFileSystem()
Description copied from interface:IResourceThe file system supporting this resource- Specified by:
getFileSystemin interfaceIResource
-
getParent
public IDirectory getParent()
Description copied from interface:IResourceGets this file's our directory's parent directory.
-
getName
public String getName()
Description copied from interface:IResourceGets this file's or directory's name.
-
exists
public boolean exists()
Description copied from interface:IResourceIndicates whether this resource exists.
-
getPath
public ResourcePath getPath()
-
isChildOf
public boolean isChildOf(IDirectory dir)
Description copied from interface:IResourceIndicates whether this resource is a direct child of the given directory.
-
isDescendantOf
public boolean isDescendantOf(IDirectory dir)
Description copied from interface:IResourceIndicates whether this resource is a descendant of the given directory.- Specified by:
isDescendantOfin interfaceIResource- Parameters:
dir- the directory which would be the ancestor- Returns:
- true if this is a descendant of the given directory
-
toJavaFile
public File toJavaFile()
- Specified by:
toJavaFilein interfaceIResource
-
isJavaFile
public boolean isJavaFile()
- Specified by:
isJavaFilein interfaceIResource
-
-