Extension SDK 10.1.2

oracle.ide.util
Class FilePath

java.lang.Object
  extended byoracle.ide.util.FilePath

public class FilePath
extends java.lang.Object

The FilePath class provides file path manipulation utility functions.


Field Summary
static int LOADING
           
static int SAVING
           
 
Constructor Summary
FilePath()
           
 
Method Summary
static java.lang.String convertPath(java.lang.String path, int direction)
          Converts a fully set of pathnames to and from the native filesystem's format to the standard JDeveloper format (Windows Format, \ and ;)
static java.lang.String getBasePath(java.lang.String absolutePath, java.lang.String relativePath)
           
static java.lang.String getExtension(java.lang.String path)
          Gets the file extension.
static java.lang.String getFilename(java.lang.String path)
          Gets the last entry in the specified path.
static java.lang.String getName(java.lang.String path)
          Gets file name without its extension.
static java.lang.String getParent(java.lang.String path)
          Gets the parent directory of the last entry in the specified path
static boolean isAbsolute(java.lang.String filename)
          Determines whether the specified filename has an absolute file path.
static java.lang.String makePathQualified(java.lang.String root, java.lang.String path)
           
static java.lang.String makePathRelative(java.lang.String root, java.lang.String path)
           
static java.lang.String makePathRelative(java.lang.String root, java.lang.String path, boolean childrenOnly)
           
static java.lang.String makeQualified(java.lang.String root, java.lang.String relative)
           
static java.lang.String makeRelative(java.lang.String root, java.lang.String path)
          Get the path relative to the specified root directory.
static java.lang.String makeRelative(java.lang.String root, java.lang.String path, boolean childrenOnly)
          Get the path relative to the specified root directory.
static boolean mayBeADirectory(java.lang.String fname)
          Return true if the specified name could be a directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOADING

public static final int LOADING
See Also:
Constant Field Values

SAVING

public static final int SAVING
See Also:
Constant Field Values
Constructor Detail

FilePath

public FilePath()
Method Detail

isAbsolute

public static final boolean isAbsolute(java.lang.String filename)
Determines whether the specified filename has an absolute file path.

Parameters:
filename - the file on which to do the check.
Returns:
true if the filename specifies an absolute file path.

makeQualified

public static final java.lang.String makeQualified(java.lang.String root,
                                                   java.lang.String relative)
Returns:
the concatenation of the root directory and the relative directory. If the relative path is already an absolute path, simply return it.

makeRelative

public static final java.lang.String makeRelative(java.lang.String root,
                                                  java.lang.String path)
Get the path relative to the specified root directory.

Parameters:
root - the path with respect to which the relative path is obtained.
path - the path whose relative relationship to root is sought.
Returns:
the relative path if available, the original path otherwise.

makeRelative

public static final java.lang.String makeRelative(java.lang.String root,
                                                  java.lang.String path,
                                                  boolean childrenOnly)
Get the path relative to the specified root directory. If 'childrenOnly' is true, do not convert any files and directories that are not children of the root.

Parameters:
root - the path with respect to which the relative path is obtained.
path - the path whose relative relationship to root is sought.
childrenOnly - indicates whether to convert the path only if it is a child of the root.
Returns:
the relative path if available, the original path otherwise.

makePathQualified

public static java.lang.String makePathQualified(java.lang.String root,
                                                 java.lang.String path)

makePathRelative

public static java.lang.String makePathRelative(java.lang.String root,
                                                java.lang.String path)

makePathRelative

public static java.lang.String makePathRelative(java.lang.String root,
                                                java.lang.String path,
                                                boolean childrenOnly)

getParent

public static final java.lang.String getParent(java.lang.String path)
Gets the parent directory of the last entry in the specified path

Parameters:
path - a file path.
Returns:
the parent directory of the last entry in the specified path.

getFilename

public static final java.lang.String getFilename(java.lang.String path)
Gets the last entry in the specified path.

Parameters:
path - a file path.
Returns:
last entry in the path.

getExtension

public static final java.lang.String getExtension(java.lang.String path)
Gets the file extension.

Parameters:
path - a file path.
Returns:
file name extension.

getName

public static final java.lang.String getName(java.lang.String path)
Gets file name without its extension.

Parameters:
path - a file path.
Returns:
the file name without an extension.

mayBeADirectory

public static final boolean mayBeADirectory(java.lang.String fname)
Return true if the specified name could be a directory.

Parameters:
fname - a file path.
Returns:
true if the specified name could be a directory.

convertPath

public static final java.lang.String convertPath(java.lang.String path,
                                                 int direction)
Converts a fully set of pathnames to and from the native filesystem's format to the standard JDeveloper format (Windows Format, \ and ;)

Parameters:
direction - to convert. This can be one of the following:
  • FilePath.LOADINGi
  • FilePath.SAVING

Returns:
the converted String

getBasePath

public static final java.lang.String getBasePath(java.lang.String absolutePath,
                                                 java.lang.String relativePath)

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.