Package org.globus.util

# Class GlobusResource

java.lang.Object
org.globus.util.GlobusResource

public class GlobusResource extends Object
This class provides a way of managing file system resources in a manner similar to the spring framework's Resource class. 3/2/2012

## Constructor Summary

Constructors
Constructor
Description
`GlobusResource(String resourcePath)`
Creates a new instance of GlobusResource referencing the specified resourcePath.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`exists()`
`File`
`getFile()`
`String`
`getFilename()`
`InputStream`
`getInputStream()`
`URI`
`getURI()`
`URL`
`getURL()`
`boolean`
`isReadable()`
`long`
`lastModified()`
`String`
`toString()`
`String`
`toURI()`
`String`
`toURL()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### GlobusResource

public GlobusResource(String resourcePath)
Creates a new instance of GlobusResource referencing the specified resourcePath.

Parameters:
  `resourcePath` - The path to the specified resource in the style /directory/directory/fileName.ext

## Method Details

### toURI

public String toURI()

Returns:
  A string representation of the resource's URI

### toURL

public String toURL() throws MalformedURLException

Returns:
  A string representation of the resource's URL
Throws:
  `MalformedURLException`

### getURI

public URI getURI() throws IOException

Returns:
  The resource's URI(java.Net.URI)
Throws:
  `IOException`

### getURL

public URL getURL() throws MalformedURLException

Returns:
  The resource's URL(java.Net.URL)
Throws:
  `MalformedURLException`

### getFile

public File getFile() throws IOException

Returns:
  A new java.io.File object referencing the resource's resourcePath
Throws:
  `IOException`

### exists

public boolean exists()

Returns:
  True if the resource exists, and false if the resource does not exist

### lastModified

public long lastModified() throws IOException

Returns:
  The time the resource was last modified
Throws:
  `IOException`

### isReadable

public boolean isReadable()

Returns:
  True if the resource is readable, false if the resource is not readable

### getInputStream

public InputStream getInputStream() throws FileNotFoundException, IOException

Returns:
  A new InputStream(java.io.InputStream) of the resource
Throws:
  `FileNotFoundException`
  `IOException`

### getFilename

public String getFilename()

Returns:
  The name of the resource in the style fileName.ext

### toString

public String toString()

Overrides:
  `toString` in class `Object`
Returns:
  A string representing resourcePath and URI of the resource