Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atlassian.bamboo.persister.xstream
Class RelativePath

    java.lang.Object
      com.atlassian.bamboo.persister.xstream.RelativePath

    public class RelativePath

extends Object

This class converts an Absolute Path into a Relative Path. Used to ensure we only persist relative paths.

Method Summary
`static List` | `getPathElements(File file)` Get a list of the files individual path elements.
`static String` | `getRelativePath(File homeDirectory, File fileToMakeRelative)` get relative path of fileToMakeRelative with respect to the homeDirectory

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getRelativePath

    public static String getRelativePath(File homeDirectory,
                                         File fileToMakeRelative)

  get relative path of fileToMakeRelative with respect to the homeDirectory

  Parameters:
    `homeDirectory` - base directory
    `fileToMakeRelative` - File we are generating the relative path
  Returns:
    The relative path to get from home to fileToMakeRelative

### getPathElements

    public static List getPathElements(File file)

  Get a list of the files individual path elements.

  For example, "/a/b/c/d.txt", will return [d.txt,c,b,a]

  Note: on Windows, "c:\foo.txt" will return [foo.txt, ] because c:\ has no name.

  Parameters:
    `file` - input file
  Returns:
    a List collection with the individual elements of the path in reverse order

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Atlassian Software Systems. All Rights Reserved.