Java Doc for FileIO.java in  » 6.0-JDK-Modules » j2me » sun » io » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » sun.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sun.io.FileIO

All known Subclasses:   sun.io.FileFileIO,
FileIO
abstract public class FileIO implements Serializable(Code)
Instances of this class represent the name of a file or directory on the host file system. A file is specified by a pathname, which can either be an absolute pathname or a pathname relative to the current working directory. The pathname must follow the naming conventions of the host platform.

The File class is intended to provide an abstraction that deals with most of the machine dependent complexities of files and pathnames in a machine-independent fashion.

Note that whenever a filename or path is used it is assumed that the host's file naming conventions are used.
version:
   1.10, 02/08/19
author:
   Saul Wold
since:
   JDK1.0



Field Summary
protected  Stringpath
     The path of the file.
final public static  StringpathSeparator
     The system-dependent path separator string.
final public static  charpathSeparatorChar
     The system-dependent path separator character.
final public static  Stringseparator
     The system-dependent path separator character.
final public static  charseparatorChar
     The system-dependent path separator string.

Constructor Summary
public  FileIO()
    
protected  FileIO(String path)
     Creates a File instance that represents the file whose pathname is the given path argument.
protected  FileIO(String path, String name)
     Creates a File instance whose pathname is the pathname of the specified directory, followed by the separator character, followed by the name argument.
protected  FileIO(FileIO dir, String name)
     Creates a File instance that represents the file with the specified name in the specified directory.

Method Summary
abstract public  booleancanRead()
     Tests if the application can read from the specified file.
abstract public  booleancanWrite()
     Tests if the application can write to this file.
abstract  StringcanonPath(String path)
    
abstract  booleandelete()
     Deletes the file specified by this object.
public  booleanequals(Object obj)
     Compares this object against the specified object. Returns true if and only if the argument is not null and is a File object whose pathname is equal to the pathname of this object.
abstract public  booleanexists()
     Tests if this File exists.
public  StringgetAbsolutePath()
     Returns the absolute pathname of the file represented by this object. If this object represents an absolute pathname, then return the pathname.
public  StringgetCanonicalPath()
     Returns the canonical form of this File object's pathname. The precise definition of canonical form is system-dependent, but it usually specifies an absolute pathname in which all relative references and references to the current user directory have been completely resolved.
abstract public  InputStreamgetInputStream()
    
public  StringgetName()
     Returns the name of the file represented by this object.
abstract public  OutputStreamgetOutputStream()
    
public  StringgetParent()
     Returns the parent part of the pathname of this File object, or null if the name has no parent part.
public  StringgetPath()
     Returns the pathname of the file represented by this object.
public  inthashCode()
     Computes a hashcode for the file.
abstract public  booleanisAbsolute()
     Tests if the file represented by this File object is an absolute pathname.
abstract public  booleanisDirectory()
     Tests if the file represented by this File object is a directory.
abstract public  booleanisFile()
     Tests if the file represented by this File object is a "normal" file.
abstract public  longlastModified()
     Returns the time that the file represented by this File object was last modified.
abstract public  longlength()
     Returns the length of the file represented by this File object.
abstract public  String[]list()
     Returns a list of the files in the directory specified by this File object.
abstract public  booleanmkdir()
     Creates a directory whose pathname is specified by this File object.
public  booleanmkdirs()
     Creates a directory whose pathname is specified by this File object, including any necessary parent directories.
public  StringtoString()
     Returns a string representation of this object.

Field Detail
path
protected String path(Code)
The path of the file. The host's file separator is used.



pathSeparator
final public static String pathSeparator(Code)
The system-dependent path separator string. This field is initialized to contain the value of File.pathSeparator.
See Also:   java.io.File.pathSeparator(java.lang.String)
since:
   JDK1.0



pathSeparatorChar
final public static char pathSeparatorChar(Code)
The system-dependent path separator character. This field is initialized to contain the first character of File.pathSeparator. This character is often used to separate filenames in a sequence of files given as a "path list".
See Also:   java.io.File.pathSeparator(java.lang.String)
since:
   JDK1.0



separator
final public static String separator(Code)
The system-dependent path separator character. This field is initialized to contain the value of File.separator.
See Also:   java.io.File.separator(java.lang.String)
since:
   JDK1.0



separatorChar
final public static char separatorChar(Code)
The system-dependent path separator string. This field is initialized to contain the first character of the value of File.separator. This character separates the directory and file components in a filename.
See Also:   java.io.File.separator(java.lang.String)
since:
   JDK1.0




Constructor Detail
FileIO
public FileIO()(Code)



FileIO
protected FileIO(String path)(Code)
Creates a File instance that represents the file whose pathname is the given path argument.
Parameters:
  path - the file pathname.
exception:
  NullPointerException - if the file path is equal tonull.
See Also:   java.io.File.getPath
since:
   JDK1.0



FileIO
protected FileIO(String path, String name)(Code)
Creates a File instance whose pathname is the pathname of the specified directory, followed by the separator character, followed by the name argument.
Parameters:
  path - the directory pathname.
Parameters:
  name - the file pathname.
See Also:   java.io.File.getPath
See Also:   java.io.File.separator
since:
   JDK1.0



FileIO
protected FileIO(FileIO dir, String name)(Code)
Creates a File instance that represents the file with the specified name in the specified directory.

If the directory argument is null, the resulting File instance represents a file in the (system-dependent) current directory whose pathname is the name argument. Otherwise, the File instance represents a file whose pathname is the pathname of the directory, followed by the separator character, followed by the name argument.
Parameters:
  dir - the directory.
Parameters:
  name - the file pathname.
See Also:   java.io.File.getPath
See Also:   java.io.File.separator
since:
   JDK1.0





Method Detail
canRead
abstract public boolean canRead()(Code)
Tests if the application can read from the specified file. true if the file specified by this object existsand the application can read the file;false otherwise.
exception:
  SecurityException - if a security manager exists, itscheckRead method is called with the pathnameof this File to see if the application isallowed read access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkRead(java.lang.String)
since:
   JDK1.0



canWrite
abstract public boolean canWrite()(Code)
Tests if the application can write to this file. true if the application is allowed to write toa file whose name is specified by this object;false otherwise.
exception:
  SecurityException - if a security manager exists, itscheckWrite method is called with the pathnameof this File to see if the application isallowed write access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkWrite(java.lang.String)
since:
   JDK1.0



canonPath
abstract String canonPath(String path) throws IOException(Code)



delete
abstract boolean delete()(Code)
Deletes the file specified by this object. If the target file to be deleted is a directory, it must be empty for deletion to succeed. true if the file is successfully deleted;false otherwise.
exception:
  SecurityException - if a security manager exists, itscheckDelete method is called with thepathname of this File to see if theapplication is allowed to delete the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkDelete(java.lang.String)
since:
   JDK1.0



equals
public boolean equals(Object obj)(Code)
Compares this object against the specified object. Returns true if and only if the argument is not null and is a File object whose pathname is equal to the pathname of this object.
Parameters:
  obj - the object to compare with. true if the objects are the same;false otherwise.
since:
   JDK1.0



exists
abstract public boolean exists()(Code)
Tests if this File exists. true if the file specified by this objectexists; false otherwise.
exception:
  SecurityException - if a security manager exists, itscheckRead method is called with the pathnameof this File to see if the application isallowed read access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkRead(java.lang.String)
since:
   JDK1.0



getAbsolutePath
public String getAbsolutePath()(Code)
Returns the absolute pathname of the file represented by this object. If this object represents an absolute pathname, then return the pathname. Otherwise, return a pathname that is a concatenation of the current user directory, the separator character, and the pathname of this file object.

The system property user.dir contains the current user directory. a system-dependent absolute pathname for this File.
See Also:   java.io.File.getPath
See Also:   java.io.File.isAbsolute
See Also:   java.lang.System.getProperty(java.lang.String)
since:
   JDK1.0




getCanonicalPath
public String getCanonicalPath() throws IOException(Code)
Returns the canonical form of this File object's pathname. The precise definition of canonical form is system-dependent, but it usually specifies an absolute pathname in which all relative references and references to the current user directory have been completely resolved. The canonical form of a pathname of a nonexistent file may not be defined.
exception:
  IOException - If an I/O error occurs, which is possible becausethe construction of the canonical path may require filesystem queries.
since:
   JDK1.1



getInputStream
abstract public InputStream getInputStream() throws IOException(Code)



getName
public String getName()(Code)
Returns the name of the file represented by this object. The name is everything in the pathame after the last occurrence of the separator character. the name of the file (without any directory components)represented by this File object.
See Also:   java.io.File.getPath
See Also:   java.io.File.separator
since:
   JDK1.0



getOutputStream
abstract public OutputStream getOutputStream() throws IOException(Code)



getParent
public String getParent()(Code)
Returns the parent part of the pathname of this File object, or null if the name has no parent part. The parent part is generally everything leading up to the last occurrence of the separator character, although the precise definition is system dependent. On UNIX, for example, the parent part of "/usr/lib" is "/usr", whose parent part is "/", which in turn has no parent. On Windows platforms, the parent part of "c:\java" is "c:\", which in turn has no parent.
See Also:   java.io.File.getPath
See Also:   java.io.File.getCanonicalPath
See Also:   java.io.File.separator
since:
   JDK1.0



getPath
public String getPath()(Code)
Returns the pathname of the file represented by this object. the pathname represented by this File object.
since:
   JDK1.0



hashCode
public int hashCode()(Code)
Computes a hashcode for the file. a hash code value for this File object.
since:
   JDK1.0



isAbsolute
abstract public boolean isAbsolute()(Code)
Tests if the file represented by this File object is an absolute pathname. The definition of an absolute pathname is system dependent. For example, on UNIX, a pathname is absolute if its first character is the separator character. On Windows platforms, a pathname is absolute if its first character is an ASCII '\' or '/', or if it begins with a letter followed by a colon. true if the pathname indicated by theFile object is an absolute pathname;false otherwise.
See Also:   java.io.File.getPath
See Also:   java.io.File.separator
since:
   JDK1.0



isDirectory
abstract public boolean isDirectory()(Code)
Tests if the file represented by this File object is a directory. true if this File exists and is adirectory; false otherwise.
exception:
  SecurityException - if a security manager exists, itscheckRead method is called with the pathnameof this File to see if the application isallowed read access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkRead(java.lang.String)
since:
   JDK1.0



isFile
abstract public boolean isFile()(Code)
Tests if the file represented by this File object is a "normal" file.

A file is "normal" if it is not a directory and, in addition, satisfies other system-dependent criteria. Any non-directory file created by a Java application is guaranteed to be a normal file. true if the file specified by this objectexists and is a "normal" file; false otherwise.
exception:
  SecurityException - If a security manager exists, itscheckRead method is called with the pathnameof this File to see if the application isallowed read access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkRead(java.lang.String)
since:
   JDK1.0




lastModified
abstract public long lastModified()(Code)
Returns the time that the file represented by this File object was last modified.

The return value is system dependent and should only be used to compare with other values returned by last modified. It should not be interpreted as an absolute time. the time the file specified by this object was last modified,or 0L if the specified file does not exist.
exception:
  SecurityException - if a security manager exists, itscheckRead method is called with the pathnameof this File to see if the application isallowed read access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkRead(java.lang.String)
since:
   JDK1.0




length
abstract public long length()(Code)
Returns the length of the file represented by this File object. the length, in bytes, of the file specified by this object,or 0L if the specified file does not exist.
exception:
  SecurityException - if a security manager exists, itscheckRead method is called with the pathnameof this File to see if the application isallowed read access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkRead(java.lang.String)
since:
   JDK1.0



list
abstract public String[] list()(Code)
Returns a list of the files in the directory specified by this File object. an array of file names in the specified directory.This list does not include the current directory or theparent directory ("." and ".."on Unix systems).
exception:
  SecurityException - If a security manager exists, itscheckRead method is called with the pathnameof this File to see if the application isallowed read access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkRead(java.lang.String)
since:
   JDK1.0



mkdir
abstract public boolean mkdir()(Code)
Creates a directory whose pathname is specified by this File object. true if the directory could be created;false otherwise.
exception:
  SecurityException - if a security manager exists, itscheckWrite method is called with the pathnameof this File to see if the application isallowed write access to the file.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkWrite(java.lang.String)
since:
   JDK1.0



mkdirs
public boolean mkdirs()(Code)
Creates a directory whose pathname is specified by this File object, including any necessary parent directories. true if the directory (or directories) could becreated; false otherwise.
exception:
  SecurityException - if a security manager exists, itscheckWrite method is called with the pathnameof each of the directories that is to be created, beforeany of the directories are created.
See Also:   java.io.File.getPath
See Also:   java.lang.SecurityManager.checkWrite(java.lang.String)
since:
   JDK1.0



toString
public String toString()(Code)
Returns a string representation of this object. a string giving the pathname of this object.
See Also:   java.io.File.getPath
since:
   JDK1.0



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.