wicket.util.file
Class File

java.lang.Object
  extended byjava.io.File
      extended bywicket.util.file.File
All Implemented Interfaces:
java.lang.Comparable, IModifiable, java.io.Serializable
Direct Known Subclasses:
Folder

public class File
extends java.io.File
implements IModifiable

Simple extension of File that adds an implementation of IModifiable for files. This allows the ModificationWatcher class to watch files for modification. The IModifiable.lastModifiedTime() method also returns a Time object with a more convenient API than either Date or a value in milliseconds.

Author:
Jonathan Locke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
File(File parent, java.lang.String child)
          Constructor.
File(java.lang.String pathname)
          Constructor.
File(java.lang.String parent, java.lang.String child)
          Constructor.
File(java.net.URI uri)
          Constructor.
 
Method Summary
 Time lastModifiedTime()
          Returns a Time object representing the most recent time this file was modified.
 void remove()
           
 void writeTo(java.io.InputStream input)
          Writes the given input stream to this file
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

File

public File(java.lang.String pathname)
Constructor.

Parameters:
pathname - path name

File

public File(java.lang.String parent,
            java.lang.String child)
Constructor.

Parameters:
parent - parent
child - child

File

public File(File parent,
            java.lang.String child)
Constructor.

Parameters:
parent - parent
child - child

File

public File(java.net.URI uri)
Constructor.

Parameters:
uri - file uri
Method Detail

lastModifiedTime

public final Time lastModifiedTime()
Returns a Time object representing the most recent time this file was modified.

Specified by:
lastModifiedTime in interface IModifiable
Returns:
This file's lastModified() value as a Time object

remove

public final void remove()
See Also:
File.delete()

writeTo

public final void writeTo(java.io.InputStream input)
                   throws java.io.IOException
Writes the given input stream to this file

Parameters:
input - The input
Throws:
java.io.IOException


Copyright © 2004-2005 Wicket developers. All Rights Reserved.