org.xerial.util.io
Interface VirtualFile

All Known Implementing Classes:
FileResource.FileInJarArchive, FileResource.SystemFile

public interface VirtualFile

VirtualFile is a common interface to handle system files and file resources in JAR. System file resources have an URL prefixed with "file:". e.g., "file:/C:/Program Files/Software/classes/org/xerial/util/FileResource.java" JAR file contents have an URL prefixed with "jar:file: e.g., "jar:file:/C:/Program Files/Software/something.jar!/org/xerial/util/FileResource.java"

Author:
leo

Method Summary
 String getLogicalPath()
          Gets the logical path of the file.
 URL getURL()
          Gets the URL of this file
 boolean isDirectory()
          is directory?
 String toString()
           
 

Method Detail

getLogicalPath

String getLogicalPath()
Gets the logical path of the file. For example, if this VirtualFile' URL is "file:/somewhere/org/xerial/util/FileResource.java", its logical name is org/xerial/util/FileResource.java, beginning from the root package.

Returns:

isDirectory

boolean isDirectory()
is directory?

Returns:
true when the file is a directory, otherwise false

getURL

URL getURL()
Gets the URL of this file

Returns:

toString

String toString()
Overrides:
toString in class Object


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.