public class WebFile extends Object implements Path
Path
methods are applied on the downloaded file.Constructor and Description |
---|
WebFile(String url)
Creates a web file using the OS temp directory + "webfiles" as
the local download location, and the URL "file" name as the local
file name.
|
WebFile(String url,
Path localFile)
Creates a web file using a local path to store the dowloaded file.
|
WebFile(URL url)
Creates a web file using the OS temp directory + "webfiles" as
the local download location, and the URL "file" name as the local
file name.
|
WebFile(URL url,
Path localFile)
Creates a web file using a local path to store the dowloaded file.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Path other) |
static WebFile |
create(String url,
Path localDir)
Creates a web file using the given directory as the local download
location, and the URL "file" name as the local file name.
|
static WebFile |
create(String url,
Path localDir,
String localName)
Creates a web file using the given directory as the local download
location, and the given name as the local file name.
|
static WebFile |
create(String url,
String localName)
Creates a web file using the OS temp directory + "webfiles" as the local
download location, and the given name as the local file name.
|
static WebFile |
create(URL url,
Path localDir)
Creates a web file using the given directory as the local download
location, and the URL "file" name as the local file name.
|
static WebFile |
create(URL url,
Path localDir,
String localName)
Creates a web file using the given directory as the local download
location, and the given name as the local file name.
|
static WebFile |
create(URL url,
String localName)
Creates a web file using the OS temp directory + "webfiles" as the local
download location, and the given name as the local file name.
|
protected void |
download(URL url,
Path localFile) |
boolean |
endsWith(Path other) |
boolean |
endsWith(String other) |
boolean |
equals(Object obj) |
Path |
getFileName() |
FileSystem |
getFileSystem() |
Path |
getName(int index) |
int |
getNameCount() |
Path |
getParent() |
Path |
getRoot() |
URL |
getUrl() |
int |
hashCode() |
boolean |
isAbsolute() |
Iterator<Path> |
iterator() |
Path |
normalize() |
WatchKey |
register(WatchService watcher,
WatchEvent.Kind<?>... events) |
WatchKey |
register(WatchService watcher,
WatchEvent.Kind<?>[] events,
WatchEvent.Modifier... modifiers) |
Path |
relativize(Path other) |
Path |
resolve(Path other) |
Path |
resolve(String other) |
Path |
resolveSibling(Path other) |
Path |
resolveSibling(String other) |
boolean |
startsWith(Path other) |
boolean |
startsWith(String other) |
Path |
subpath(int beginIndex,
int endIndex) |
Path |
toAbsolutePath() |
File |
toFile() |
Path |
toRealPath(LinkOption... options) |
String |
toString() |
URI |
toUri() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public WebFile(String url)
url
- URL to downloadpublic WebFile(String url, Path localFile)
null
, invoking this method
is the same as invoking WebFile(URL)
url
- URL to downloadlocalFile
- full file path to local file destinationpublic WebFile(URL url)
url
- URL to downloadpublic WebFile(URL url, Path localFile)
null
, invoking this method
is the same as invoking WebFile(URL)
url
- URL to downloadlocalFile
- full file path to local file destinationpublic static WebFile create(String url, Path localDir)
url
- URL to downloadlocalDir
- full directory path to local directory destinationpublic static WebFile create(String url, Path localDir, String localName)
url
- URL to downloadlocalDir
- full directory path to local directory destinationlocalName
- local file namepublic static WebFile create(String url, String localName)
url
- URL to downloadlocalName
- local file namepublic static WebFile create(URL url, Path localDir)
url
- URL to downloadlocalDir
- full directory path to local directory destinationpublic static WebFile create(URL url, Path localDir, String localName)
url
- URL to downloadlocalDir
- full directory path to local directory destinationlocalName
- local file namepublic static WebFile create(URL url, String localName)
url
- URL to downloadlocalName
- local file namepublic URL getUrl()
public FileSystem getFileSystem()
getFileSystem
in interface Path
public boolean isAbsolute()
isAbsolute
in interface Path
public Path getFileName()
getFileName
in interface Path
public int getNameCount()
getNameCount
in interface Path
public boolean startsWith(Path other)
startsWith
in interface Path
public boolean startsWith(String other)
startsWith
in interface Path
public Path resolveSibling(Path other)
resolveSibling
in interface Path
public Path resolveSibling(String other)
resolveSibling
in interface Path
public Path relativize(Path other)
relativize
in interface Path
public Path toAbsolutePath()
toAbsolutePath
in interface Path
public Path toRealPath(LinkOption... options) throws IOException
toRealPath
in interface Path
IOException
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException
register
in interface Path
register
in interface Watchable
IOException
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events) throws IOException
register
in interface Path
register
in interface Watchable
IOException
public int compareTo(Path other)
compareTo
in interface Comparable<Path>
compareTo
in interface Path
public String toString()
public boolean equals(Object obj)
Copyright © 2008–2023 Norconex Inc.. All rights reserved.