Package gw.fs.url
Class URLFileImpl
- java.lang.Object
-
- gw.fs.url.URLFileImpl
-
-
Field Summary
-
Fields inherited from interface gw.fs.IFile
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description URLFileImpl(URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
create()
boolean
delete()
boolean
exists()
Indicates whether this resource exists.String
getBaseName()
String
getExtension()
String
getName()
Gets this file's or directory's name.IDirectory
getParent()
Gets this file's our directory's parent directory.ResourcePath
getPath()
boolean
isChildOf(IDirectory dir)
Indicates whether this resource is a direct child of the given directory.boolean
isDescendantOf(IDirectory dir)
Indicates whether this resource is a descendant of the given directory.boolean
isInJar()
boolean
isJavaFile()
InputStream
openInputStream()
OutputStream
openOutputStream()
OutputStream
openOutputStreamForAppend()
File
toJavaFile()
URI
toURI()
-
-
-
Constructor Detail
-
URLFileImpl
public URLFileImpl(URL url)
-
-
Method Detail
-
openInputStream
public InputStream openInputStream() throws IOException
- Specified by:
openInputStream
in interfaceIFile
- Throws:
IOException
-
openOutputStream
public OutputStream openOutputStream() throws IOException
- Specified by:
openOutputStream
in interfaceIFile
- Throws:
IOException
-
openOutputStreamForAppend
public OutputStream openOutputStreamForAppend() throws IOException
- Specified by:
openOutputStreamForAppend
in interfaceIFile
- Throws:
IOException
-
getExtension
public String getExtension()
- Specified by:
getExtension
in interfaceIFile
-
getBaseName
public String getBaseName()
- Specified by:
getBaseName
in interfaceIFile
-
getParent
public IDirectory getParent()
Description copied from interface:IResource
Gets this file's our directory's parent directory.
-
getName
public String getName()
Description copied from interface:IResource
Gets this file's or directory's name.
-
exists
public boolean exists()
Description copied from interface:IResource
Indicates whether this resource exists.
-
delete
public boolean delete() throws IOException
- Specified by:
delete
in interfaceIResource
- Throws:
IOException
-
getPath
public ResourcePath getPath()
-
isChildOf
public boolean isChildOf(IDirectory dir)
Description copied from interface:IResource
Indicates whether this resource is a direct child of the given directory.
-
isDescendantOf
public boolean isDescendantOf(IDirectory dir)
Description copied from interface:IResource
Indicates whether this resource is a descendant of the given directory.- Specified by:
isDescendantOf
in 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:
toJavaFile
in interfaceIResource
-
isJavaFile
public boolean isJavaFile()
- Specified by:
isJavaFile
in interfaceIResource
-
-