| java.lang.Object com.hp.hpl.jena.util.FileUtils
FileUtils | public class FileUtils (Code) | | |
encodingUTF8 | final public static String encodingUTF8(Code) | | Java name for UTF-8 encoding
|
getBasename | public static String getBasename(String filename)(Code) | | Get the basename of a filename
Parameters: filename - Base filename. |
getDirname | public static String getDirname(String filename)(Code) | | Get the directory part of a filename
Parameters: filename - Directory name |
getFilenameExt | public static String getFilenameExt(String filename)(Code) | | Get the suffix part of a file name or a URL in file-like format.
|
getScratchDirectory | public static File getScratchDirectory(String prefix)(Code) | | Answer a File naming a freshly-created directory in the temporary directory. This
directory should be deleted on exit.
TODO handle threading issues, mkdir failure, and better cleanup
Parameters: prefix - the prefix for the directory name a File naming the new directory |
getTempDirectory | public static String getTempDirectory()(Code) | | |
guessLang | public static String guessLang(String name, String otherwise)(Code) | | Guess the language/type of model data. Updated by Chris, hived off the
model-suffix part to FileUtils as part of unifying it with similar code in FileGraph.
- If the URI of the model starts jdbc: it is assumed to be an RDB model
- If the URI ends ".rdf", it is assumed to be RDF/XML
- If the URI end .nt, it is assumed to be N-Triples
- If the URI end .bdb, it is assumed to be BerkeleyDB model [suppressed at present]
Parameters: name - URL to base the guess on Parameters: otherwise - Default guess String Guessed syntax - or the default supplied |
guessLang | public static String guessLang(String urlStr)(Code) | | Guess the language/type of model data
- If the URI of the model starts jdbc: it is assumed to be an RDB model
- If the URI ends .rdf, it is assumed to be RDF/XML
- If the URI ends .n3, it is assumed to be N3
- If the URI ends .nt, it is assumed to be N-Triples
- If the URI ends .bdb, it is assumed to be BerkeleyDB model
Parameters: urlStr - URL to base the guess on String Guessed syntax - default is RDF/XML |
isFile | public static boolean isFile(String name)(Code) | | Check whether 'name' is possibly a file reference
Parameters: name - boolean False if clearly not a filename. |
isURI | public static boolean isURI(String name)(Code) | | Check whether a name is an absolute URI (has a scheme name)
Parameters: name - boolean True if there is a scheme name |
openResourceFile | public static BufferedReader openResourceFile(String filename)(Code) | | Answer a BufferedReader than reads from the named resource file as
UTF-8, possibly throwing WrappedIOExceptions.
|
tempFileName | public static File tempFileName(String prefix, String suffix)(Code) | | create a temporary file that will be deleted on exit, and do something
sensible with any IO exceptions - namely, throw them up wrapped in
a JenaException.
Parameters: prefix - the prefix for File.createTempFile Parameters: suffix - the suffix for File.createTempFile the temporary File |
toFilename | public static String toFilename(String filenameOrURI)(Code) | | Turn a file: URL or file name into a plain file name
|
toURL | public static String toURL(String filename)(Code) | | Turn a plain filename into a "file:" URL
|
|
|