public class FileChangedChecker extends Object
Constructor and Description |
---|
FileChangedChecker(File file)
Creates the file change checker instance.
|
FileChangedChecker(File file,
boolean checkExist)
Creates the file change checker instance.
|
FileChangedChecker(String fileName)
Creates the file change checker instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
existsAsFile()
Checks if this is an existing file.
|
String |
getError()
Checks that the file exists and is a file.
|
File |
getFile()
Gets the file instance.
|
String |
getFileName()
Gets the file name being checked.
|
boolean |
hasChanged()
Checks if the file has changed.
|
boolean |
isNewerThan(File file)
Checks if this file is newer than the one specified.
|
boolean |
isNewerThan(String fileName)
Checks if this file is newer than the one specified.
|
long |
lastModified()
Returns the time that the file denoted by this abstract pathname was last modified.
|
long |
length()
Returns the length of the file denoted by this abstract pathname.
|
void |
update()
Requests an update of the file size and last modification time, if the file has been changed.
|
public FileChangedChecker(File file)
public FileChangedChecker(String fileName)
public FileChangedChecker(File file, boolean checkExist)
public String getFileName()
public boolean hasChanged()
public void update()
public long lastModified()
public long length()
public boolean isNewerThan(File file)
file
- The file to compare last modified time with.public boolean isNewerThan(String fileName)
fileName
- The file name to compare last modified time with.public String getError()
public boolean existsAsFile()
public File getFile()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.