Package helma.framework.repository

# Interface Resource

All Known Implementing Classes:
  `AbstractResource`, `FileResource`, `ZipResource`

public interface Resource
Resource represents a pointer to some kind of information (code, skin, ...) from which the content can be fetched

## Method Summary

Modifier and Type
Method
Description
`boolean`
`exists()`
Checks wether this resource actually (still) exists
`String`
`getBaseName()`
Returns the short name of the resource with the file extension (everything following the last dot character) cut off.
`String`
`getContent()`
Returns the content of the resource
`String`
`getContent(String encoding)`
Returns the content of the resource in a given encoding
`InputStream`
`getInputStream()`
Returns an input stream to the content of the resource
`long`
`getLength()`
Returns the lengh of the resource's content
`String`
`getName()`
Returns the name of the resource; does not include the name of the repository the resource was fetched from
`Resource`
`getOverloadedResource()`
Get a Resource this Resource is overloading
`Repository`
`getRepository()`
Returns the repository the resource does belong to
`String`
`getShortName()`
Returns the short name of the resource which is its name exclusive file ending if it exists
`URL`
`getUrl()`
Returns an url to the resource if the repository of this resource is able to provide urls
`long`
`lastModified()`
Returns the date the resource was last modified
`void`
`setOverloadedResource(Resource res)`
Method for registering a Resource this Resource is overloading

## Method Details

### lastModified

long lastModified()
Returns the date the resource was last modified

Returns:
  last modified date

### exists

boolean exists()
Checks wether this resource actually (still) exists

Returns:
  true if the resource exists

### getLength

long getLength() throws IOException
Returns the lengh of the resource's content

Returns:
  content length
Throws:
  `IOException` - I/O related problem

### getInputStream

InputStream getInputStream() throws IOException
Returns an input stream to the content of the resource

Returns:
  content input stream
Throws:
  `IOException` - I/O related problem

### getContent

String getContent(String encoding) throws IOException
Returns the content of the resource in a given encoding

Parameters:
  `encoding` - the character encoding
Returns:
  content
Throws:
  `IOException` - I/O related problem

### getContent

String getContent() throws IOException
Returns the content of the resource

Returns:
  content
Throws:
  `IOException` - I/O related problem

### getName

String getName()
Returns the name of the resource; does not include the name of the repository the resource was fetched from

Returns:
  name of the resource

### getShortName

String getShortName()
Returns the short name of the resource which is its name exclusive file ending if it exists

Returns:
  short name of the resource

### getBaseName

String getBaseName()
Returns the short name of the resource with the file extension (everything following the last dot character) cut off.

Returns:
  the file name without the file extension

### getUrl

URL getUrl() throws UnsupportedOperationException
Returns an url to the resource if the repository of this resource is able to provide urls

Returns:
  url to the resource
Throws:
  `UnsupportedOperationException` - if resource does not support URL schema

### getOverloadedResource

Resource getOverloadedResource()
Get a Resource this Resource is overloading

Returns:
  the overloaded resource

### setOverloadedResource

void setOverloadedResource(Resource res)
Method for registering a Resource this Resource is overloading

Parameters:
  `res` - the overloaded resource

### getRepository

Repository getRepository()
Returns the repository the resource does belong to

Returns:
  upper repository