public abstract class FsHelper
extends java.lang.Object
Constructor and Description |
---|
FsHelper() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
createFileReference(java.net.URL url)
Create a file reference from a URL using the platform default encoding for the URL.
|
static java.io.File |
createFileReference(java.net.URL url,
java.lang.String charset)
Create a file reference from a URL using the platform default encoding for the URL.
|
static java.io.FileFilter |
createFilter(java.lang.String filterExpression,
java.lang.String filterImpl) |
static java.net.URL |
createUrlFromString(java.lang.String s)
Deprecated.
use
createUrlFromString(String, boolean) since 3.0.3 |
static java.net.URL |
createUrlFromString(java.lang.String s,
boolean backslashConvert)
Creates a
URL based on the passed destination. |
static java.io.FileFilter |
logWarningIfRequired(java.io.FileFilter f) |
static java.io.File |
renameFile(java.io.File file,
java.lang.String suffix,
FsWorker worker) |
static java.io.File |
toFile(java.lang.String s)
Go straight to a
File from a url style string. |
public static java.io.File toFile(java.lang.String s) throws java.io.IOException, java.net.URISyntaxException
File
from a url style string.java.io.IOException
java.net.URISyntaxException
public static java.io.File createFileReference(java.net.URL url) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
createFileReference(URL, String)
public static java.io.File createFileReference(java.net.URL url, java.lang.String charset) throws java.io.UnsupportedEncodingException
url
- the URL.charset
- the encoding that the url is considered to be in.java.io.UnsupportedEncodingException
- if the encoding was not supported.@Deprecated public static java.net.URL createUrlFromString(java.lang.String s) throws java.io.IOException, java.net.URISyntaxException
createUrlFromString(String, boolean)
since 3.0.3URL
based on the passed destination.
If a scheme
is present and is equal to file
then the URL is deemed to be absolute and is used
as is. If the scheme
is null then the URL is considered a "file"
URL, and relative> to the
current working directory.
Note that this method will not convert backslashes into forward slashes, so passing in a string like ..\dir\
will fail
with a URISyntaxException; use createUrlFromString(String, boolean)
to convert backslashes into forward slashes prior
to processing.
s
- the String to convert to a URL.java.io.IOException
java.net.URISyntaxException
createUrlFromString(String, boolean)
public static java.net.URL createUrlFromString(java.lang.String s, boolean backslashConvert) throws java.io.IOException, java.net.URISyntaxException
URL
based on the passed destination.
If a scheme
is present and is equal to file
then the URL is deemed to be absolute and is used
as is. If the scheme
is null then the URL is considered a "file"
URL, and relative> to the
current working directory.
s
- the string to convert to a URL.backslashConvert
- whether or not to convert backslashes into forward slashes.java.io.IOException
java.net.URISyntaxException
public static java.io.FileFilter createFilter(java.lang.String filterExpression, java.lang.String filterImpl) throws java.lang.Exception
java.lang.Exception
public static java.io.FileFilter logWarningIfRequired(java.io.FileFilter f)
public static java.io.File renameFile(java.io.File file, java.lang.String suffix, FsWorker worker) throws FsException
FsException