edu.mayo.bsi.ngsportal.shared
Class FileLocation

java.lang.Object
  extended by edu.mayo.bsi.ngsportal.shared.FileLocation
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable

public class FileLocation
extends Object
implements com.google.gwt.user.client.rpc.IsSerializable

Class that holds all the information about a file location in one of the location archives

@author Gregory Dougherty


Constructor Summary
FileLocation(String name, String description, String pathTemplate, String linkTemplate)
          Normal Constructor
 
Method Summary
 String getDescription(String filePath)
          Get a human readable description of where the given file is, or null if it's not in the FileLocation's path
 String getLink(String filePath)
          Get the http or ftp link to access the specified file
 String getName()
           
 String getPathTemplate()
          Get the path template for this file location
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileLocation

public FileLocation(String name,
                    String description,
                    String pathTemplate,
                    String linkTemplate)
Normal Constructor

Parameters:
name - Name of the File Location
description - Description of the File Location
pathTemplate - The path template used by this file location
linkTemplate - The text to replace the "/.+/delivery/" with. If the template doesn't end with "/", then paths will be made HTML safe
Method Detail

getName

public final String getName()
Returns:
the name

getPathTemplate

public final String getPathTemplate()
Get the path template for this file location

Returns:
the pathTemplate

getLink

public String getLink(String filePath)
Get the http or ftp link to access the specified file

Parameters:
filePath - The path to turn into a link
Returns:
The link. null if filePath is empty, null, or specifies a file not in this file location

getDescription

public String getDescription(String filePath)
Get a human readable description of where the given file is, or null if it's not in the FileLocation's path

Parameters:
filePath - The file we're interested in
Returns:
The description, null if filePath is null, empty, or not part of the FileLocation's path