Extension SDK 9.0.5

oracle.jdeveloper.vcs.util
Class VCSFileSystemUtils

java.lang.Object
  extended byoracle.jdeveloper.vcs.util.VCSFileSystemUtils

public final class VCSFileSystemUtils
extends java.lang.Object

Utility class for file system operations.

Since:
9.0.5

Method Summary
static java.net.URL[] canonicalizeURLs(java.net.URL[] urls)
          Canonicalizes the given URLs and returns them in a new array.
static java.net.URL[] getParentURLs(java.net.URL url)
          Gets all parent URLs for the given file.
static java.lang.String getPlatformPathName(java.net.URL url)
          Gets the platform-dependent String representation of the URL.
static java.lang.String[] getURLFileNames(java.net.URL[] urls)
          Gets the filenames (including extensions) of the given URLs.
static boolean isBaseURLFor(java.net.URL url1, java.net.URL url2)
          Asks whether url1 represents a directory and url2 points to a location within url1's directory tree.
static java.net.URL newFileURL(java.lang.String filePath)
          Creates a new URL using the "file" protocol.
static java.net.URL[] newTargetURLs(java.net.URL[] urls, java.net.URL target)
          Creates new URLs for the target URL directory.
static java.util.Map organizeURLsByParent(java.net.URL[] urls)
          Organizes the given URLs by their parent directories.
static java.net.URL[] removeRefAndQueryParts(java.net.URL[] urls)
          Removes the reference and query parts of the given URLs.
static java.net.URL searchSystemPath(java.lang.String name)
          Searches the system environment path for a named executable URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

organizeURLsByParent

public static final java.util.Map organizeURLsByParent(java.net.URL[] urls)
Organizes the given URLs by their parent directories.

Parameters:
urls - the URLs to organize.
Returns:
the resulting data structure (URL -> Collection).

getURLFileNames

public static final java.lang.String[] getURLFileNames(java.net.URL[] urls)
Gets the filenames (including extensions) of the given URLs.

Parameters:
urls - the URLs whose filenames should be obtained.
Returns:
an array of filenames.

canonicalizeURLs

public static final java.net.URL[] canonicalizeURLs(java.net.URL[] urls)
Canonicalizes the given URLs and returns them in a new array.

Parameters:
urls - the URLs to canonicalize.
Returns:
the array of canonicalized URLs.

searchSystemPath

public static final java.net.URL searchSystemPath(java.lang.String name)
Searches the system environment path for a named executable URL.

Parameters:
name - the name of the executable file (minus extension) to search for.
Returns:
the accepted URL found first on the system path. (null-capable)

getParentURLs

public static final java.net.URL[] getParentURLs(java.net.URL url)
Gets all parent URLs for the given file.

Returns:
the array of parent directory URLs.

isBaseURLFor

public static final boolean isBaseURLFor(java.net.URL url1,
                                         java.net.URL url2)
Asks whether url1 represents a directory and url2 points to a location within url1's directory tree. If the URLs are equal and do not represent directories, this method will return with true (unlike the URLFileSystem implementation).

Parameters:
url1 - the potential base URL.
url2 - the URL to test.
Returns:
a verdict on whether url1 is a base URL.

newTargetURLs

public static final java.net.URL[] newTargetURLs(java.net.URL[] urls,
                                                 java.net.URL target)
Creates new URLs for the target URL directory.

Parameters:
urls - the source URLs on which new URLs are based.
target - the target URL directory.
Returns:
the target URLs.

newFileURL

public static final java.net.URL newFileURL(java.lang.String filePath)
Creates a new URL using the "file" protocol. If the argument is a directory format path then a directory URL will be created.

Parameters:
filePath - the path for the URL to create.
Returns:
the created URL instance.

getPlatformPathName

public static final java.lang.String getPlatformPathName(java.net.URL url)
Gets the platform-dependent String representation of the URL. If the argument is a directory URL then a directory format path will be returned.

Parameters:
url - the URL for the path to return.
Returns:
The path portion of the specified URL in platform-dependent notation.

removeRefAndQueryParts

public static final java.net.URL[] removeRefAndQueryParts(java.net.URL[] urls)
Removes the reference and query parts of the given URLs. Non-sanitizing.

Parameters:
urls - the URLs whose reference and query parts will be removed.
Returns:
the new URLs based on those given, minus reference and query information.

Extension SDK

 

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