|
Servertec Foundation Classes 1.3.3 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstec.sfc.Win32.FileEnumerator
public final class FileEnumerator
Used to enumerate throught all the files matching the specified mask.
If a file mask is not specified then only the specified item is returned.
. and .. are normally included in a directory listing.
Constructor Summary | |
---|---|
FileEnumerator(java.lang.String path)
Constructs a new FileEnumerator object. |
Method Summary | |
---|---|
void |
close()
Close this FileEnumerator. |
int |
getAttributes()
Returns the current file's attributes as defined in FileAttribte. |
long |
getCreationTime()
Returns the current file's creation timestamp. |
long |
getLastAccessedTime()
Returns the current file's last accessed timestamp. |
long |
getLastModifiedTime()
Returns the current file's last modified timestamp. |
java.lang.String |
getName()
Returns the current file's name. |
void |
getNextFile()
Called to retrieve the next entry. |
long |
getSize()
Returns the current file's size in bytes. |
boolean |
hasMoreFiles()
Returns whether there are any more files in this FileEnumeration. |
boolean |
isOpen()
Returns whether the FileEnumerator is open. |
java.lang.String |
toString()
Returns the specified path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileEnumerator(java.lang.String path) throws java.io.IOException
If one or more elements are available the constructor retrieves the first element.
path
- the file path including any wildcard characters (* and ?).
If a file mask is not specified then only the specified item is returned.
java.io.IOException
- if an IO error occurs.Method Detail |
---|
public final void close() throws java.io.IOException
Although finalize() closes any FileEnumerator left opened when the garbage collector does its cleanup, it is recommened that FileEnumerator be explicitely closed as soon as they are no longer needed.
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final int getAttributes() throws java.io.IOException
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final long getCreationTime() throws java.io.IOException
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final long getLastModifiedTime() throws java.io.IOException
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final long getLastAccessedTime() throws java.io.IOException
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final long getSize() throws java.io.IOException
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final boolean hasMoreFiles() throws java.io.IOException
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final java.lang.String getName() throws java.io.IOException
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.public final void getNextFile() throws java.io.IOException, java.util.NoSuchElementException
Unlike Enumeration.nextElement() which is called before the first element is retrieved, getNextFile() must be called to retrieve the next element after the first element is processed.
java.utils.NoSuchElementException
- if there were no more files.
java.io.IOException
- if the FileEnumerator is already closed or if an IO error occurs.
java.util.NoSuchElementException
public final boolean isOpen()
public final java.lang.String toString()
toString
in class java.lang.Object
|
Servertec Foundation Classes 1.3.3 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2005 Servertec. All rights reserved.