## com.arsdigita.docmgr
Interface Resource

All Known Implementing Classes:
  ResourceImpl

public interface Resource

This interface describes the functionality common to operations on files and folders in the document manager application. Concrete implementations of this interface may vary in the implementation of the data store. For example, persistent data for resource might be stored in a file system or a database.

Version:
  $Id: //apps/docmgr/dev/src/com/arsdigita/docmgr/Resource.java#4 $
Author:
  Stefan Deusch (stefan@arsdigita.com)

Field Summary
`static String` `SEPARATOR` The path-separator character, represented as a string for convenience.
`static char` `SEPARATOR_CHAR` The path-separator character.

Method Summary
`Resource` `copyTo(Resource parent)` Copies the resource into another location.
`Resource` `copyTo(String name)` Copies the resource into the same location (same parent) with a new name.
`Resource` `copyTo(String name, Resource parent)` Copies the resource into another location with a new name.
`String` `getDescription()` Returns a description of the resource, or null if no description has been provided.
`BigDecimal` `getID()` Returns a unique identifier for this resource.
`String` `getName()` Returns the name of the file or folder corresponding to this resource.
`Resource` `getParent()` Returns the path name of this resource's parent, or null if this resource does not have a parent.
`String` `getPath()` Converts this resource into a pathname string.
`boolean` `isFile()` Tests whether this resource is a file.
`boolean` `isFolder()` Tests whether this resource is a folder.
`String` `toString()` Returns the pathname string of this resource.
`URL` `toURL()` Returns the URL corresponding to this resource.

Field Detail

### SEPARATOR

    public static final String SEPARATOR

  The path-separator character, represented as a string for convenience.

  See Also:
    Constant Field Values

### SEPARATOR_CHAR

    public static final char SEPARATOR_CHAR

  The path-separator character.

Method Detail

### getName

    public String getName()

  Returns the name of the file or folder corresponding to this resource.

### getDescription

    public String getDescription()

  Returns a description of the resource, or null if no description has been provided.

### getParent

    public Resource getParent()

  Returns the path name of this resource's parent, or null if this resource does not have a parent.

### getPath

    public String getPath()

  Converts this resource into a pathname string.

### isFolder

    public boolean isFolder()

  Tests whether this resource is a folder.

### isFile

    public boolean isFile()

  Tests whether this resource is a file.

### copyTo

    public Resource copyTo(Resource parent)
                    throws ResourceExistsException

  Copies the resource into another location. Preserves the original name of the resource but places the copy inside a new parent resource.

  Parameters:
    `parent` - the parent of the copy
  Returns:
    a copy of the original resource
  Throws:
    `ResourceExistsException`

### copyTo

    public Resource copyTo(String name,
                           Resource parent)
                    throws ResourceExistsException

  Copies the resource into another location with a new name.

  Parameters:
    `name` - the name of the copy
    `parent` - the parent of the copy
  Returns:
    a copy of the original resource.
  Throws:
    `ResourceExistsException`

### copyTo

    public Resource copyTo(String name)
                    throws ResourceExistsException

  Copies the resource into the same location (same parent) with a new name.

  Parameters:
    `name` - the name of the copy
  Returns:
    a copy of the original resource.
  Throws:
    `ResourceExistsException`

### toString

    public String toString()

  Returns the pathname string of this resource.

### toURL

    public URL toURL()

  Returns the URL corresponding to this resource.

### getID

    public BigDecimal getID()

  Returns a unique identifier for this resource.

Copyright (c) 2006 Red Hat, Inc. Corporation. All Rights Reserved. Generated at June 1 2006:1113 UTC