Extension SDK 10.1.2

oracle.ide.net
Class HttpURLFileSystemHelper

java.lang.Object
  extended byoracle.ide.net.URLFileSystemHelper
      extended byoracle.ide.net.HttpURLFileSystemHelper

public class HttpURLFileSystemHelper
extends URLFileSystemHelper

The HttpURLFileSystemHelper class provides an implementation of URLFileSystemHelper for http URLs.


Constructor Summary
HttpURLFileSystemHelper()
           
 
Method Summary
 boolean canCreate(java.net.URL url)
          Tests whether the application can create the resource at the specified URL.
 boolean exists(java.net.URL url)
          Returns true if the specified URL points to a resource that currently exists; returns false otherwise.
 long getLength(java.net.URL url)
          Returns the number of bytes contained in the resource that the specified URL points to.
 java.net.URL getParent(java.net.URL url)
          Returns the URL representing the parent directory of the specified URL.
protected  boolean haveSamePort(java.net.URL url1, java.net.URL url2)
           
 long lastModified(java.net.URL url)
          Returns the last modification time (timestamp) of the resource indicated by the specified URL in milliseconds since 00:00:00 GMT, Jan 1, 1970.
 java.io.InputStream openInputStream(java.net.URL url)
          Opens an InputStream on the specified URL.
 
Methods inherited from class oracle.ide.net.URLFileSystemHelper
appendRelativePath, areEqual, areEqualPathElems, canonicalize, canRead, canWrite, convertSuffix, createTempFile, delete, ensureSuffix, equals, getBaseParent, getDefaultIcon, getFileName, getName, getPath, getPathNoExt, getPlatformPathName, getSuffix, getSystemIcon, hasSuffix, haveSameAuthority, haveSameHost, haveSamePath, haveSameProtocol, haveSameQuery, haveSameRef, haveSameUserInfo, isBaseURLFor, isDirectory, isDirectoryPath, isHidden, isReadOnly, isRegularFile, isValid, list, list, listRoots, ls, ls, mkdir, mkdirs, openOutputStream, renameTo, setLastModified, setReadOnly, toDisplayString, toEncodedString, toRelativeSpec, toRelativeSpec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpURLFileSystemHelper

public HttpURLFileSystemHelper()
Method Detail

getLength

public long getLength(java.net.URL url)
Returns the number of bytes contained in the resource that the specified URL points to. If the length cannot be determined, -1 is returned.

The default implementation attempts to get the content length from the URLConnection associated with the URL. If that fails for some reason (e.g. the resource does not exist, there was some other an I/O exception, etc.), -1 is returned.

Overrides:
getLength in class URLFileSystemHelper
See Also:
URLConnection

lastModified

public long lastModified(java.net.URL url)
Returns the last modification time (timestamp) of the resource indicated by the specified URL in milliseconds since 00:00:00 GMT, Jan 1, 1970. If the timestamp can't be determined, -1 is returned.

The default implementation attemps to get the last modified time from the URLConnection associated with the URL. If that fails for some reason (e.g. the resource does not exist, there was some other I/O exception, etc.), -1 is returned.

Overrides:
lastModified in class URLFileSystemHelper
See Also:
URLConnection

exists

public boolean exists(java.net.URL url)
Description copied from class: URLFileSystemHelper
Returns true if the specified URL points to a resource that currently exists; returns false otherwise.

The default implementation simply returns false without doing anything.

Overrides:
exists in class URLFileSystemHelper

canCreate

public boolean canCreate(java.net.URL url)
Tests whether the application can create the resource at the specified URL.

Overrides:
canCreate in class URLFileSystemHelper
Returns:
true if the resource at the specified URL exists or can be created; false otherwise.

getParent

public java.net.URL getParent(java.net.URL url)
Description copied from class: URLFileSystemHelper
Returns the URL representing the parent directory of the specified URL. If there is no parent directory, then null is returned.

The default implementation returns the value of invoking URLFactory.newURL( url, ".." ).

Overrides:
getParent in class URLFileSystemHelper

openInputStream

public java.io.InputStream openInputStream(java.net.URL url)
                                    throws java.io.IOException
Opens an InputStream on the specified URL.

The default implementation attempts to open the InputStream through the URLConnection associated with the URL. If the URLConnection implementation does not support an InputStream then an UnknownServiceException (a runtime exception) will be thrown.

Overrides:
openInputStream in class URLFileSystemHelper
Throws:
java.io.FileNotFoundException - if the resource at the specified URL does not exist.
java.io.IOException - if an I/O error occurs when trying to open the InputStream.
java.net.UnknownServiceException - if the URLConnection backing the specified URL does not support an InputStream.
See Also:
IOException, URLConnection, UnknownServiceException

haveSamePort

protected boolean haveSamePort(java.net.URL url1,
                               java.net.URL url2)
Overrides:
haveSamePort in class URLFileSystemHelper

Extension SDK

 

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