Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.io
Class File

java.lang.Object
  extended by oracle.adfnmc.java.io.File
All Implemented Interfaces:
Comparable

public class File
extends java.lang.Object
implements Comparable


Field Summary
static java.lang.Class CLASS_INSTANCE
           
static java.lang.String fileSchemePrefix
           
static java.lang.String pathSeparator
           
static char pathSeparatorChar
           
static java.lang.String separator
           
static char separatorChar
           
 
Constructor Summary
File(java.lang.String pathname)
           
 
Method Summary
 boolean canRead()
           
 boolean canWrite()
           
 int compareTo(java.lang.Object obj)
          Answers the relative sort ordering of paths for the receiver and given argument.
 boolean createNewFile()
           
 boolean delete()
          Attempt to delete the file
 boolean equals(java.lang.Object obj)
           
 boolean exists()
          Does this file exist?
 java.lang.String getName()
           
 java.lang.String getParent()
          Answers the pathname of the parent of this File.
 File getParentFile()
          Answers a new File made from the pathname of the parent of this File.
 java.lang.String getPath()
           
 boolean isAbsolute()
           
 boolean isDirectory()
          Is this a directory?
 boolean isFile()
           
 boolean isHidden()
           
 long lastModified()
           
 long length()
          Returns the file's size, in bytes.
 java.lang.String[] list()
           
static File[] listRoots()
           
 boolean mkdir()
          Make the directory specified by the path
 boolean mkdirs()
          Create all the directories needed for this File.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE

separatorChar

public static final char separatorChar
See Also:
Constant Field Values

separator

public static final java.lang.String separator
See Also:
Constant Field Values

pathSeparatorChar

public static final char pathSeparatorChar
See Also:
Constant Field Values

pathSeparator

public static final java.lang.String pathSeparator
See Also:
Constant Field Values

fileSchemePrefix

public static final java.lang.String fileSchemePrefix
See Also:
Constant Field Values
Constructor Detail

File

public File(java.lang.String pathname)
Method Detail

exists

public boolean exists()
Does this file exist?


isDirectory

public boolean isDirectory()
Is this a directory?


isFile

public boolean isFile()

mkdir

public boolean mkdir()
Make the directory specified by the path


createNewFile

public boolean createNewFile()
                      throws java.io.IOException
Throws:
java.io.IOException

getPath

public java.lang.String getPath()

length

public long length()
Returns the file's size, in bytes.

Returns:

delete

public boolean delete()
Attempt to delete the file


getName

public java.lang.String getName()

list

public java.lang.String[] list()

compareTo

public int compareTo(java.lang.Object obj)
Answers the relative sort ordering of paths for the receiver and given argument. The ordering is platform dependent.

Specified by:
compareTo in interface Comparable
Parameters:
another - a File to compare the receiver to
Returns:
an int determined by comparing the two paths. The meaning is described in the Comparable interface.
See Also:
Comparable

getParent

public java.lang.String getParent()
Answers the pathname of the parent of this File. This is the path up to but not including the last name. null is returned when there is no parent.

Returns:
the parent name or null

isHidden

public boolean isHidden()

lastModified

public long lastModified()

canRead

public boolean canRead()

canWrite

public boolean canWrite()

mkdirs

public boolean mkdirs()
Create all the directories needed for this File. If the terminal directory already exists, answer false. If the directories were created successfully, answer true.

Returns:
true if the necessary directories were created, false otherwise.

listRoots

public static File[] listRoots()

getParentFile

public File getParentFile()
Answers a new File made from the pathname of the parent of this File. This is the path up to but not including the last name. null is returned when there is no parent.

Returns:
a new File representing parent or null

isAbsolute

public boolean isAbsolute()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.