com.scooterframework.builtin
Class BuiltinHelper

java.lang.Object
  extended by com.scooterframework.builtin.BuiltinHelper

public class BuiltinHelper
extends java.lang.Object

BuiltinHelper class has helper methods for built-ins.


Field Summary
static java.lang.String FILE_BROWSER_LINK_PREFIX
           
static java.lang.String FILE_BROWSER_LINK_PREFIX_DIR
           
static java.lang.String FILE_BROWSER_LINK_PREFIX_FILE
           
static java.lang.String FILE_BROWSER_LINK_ROOT
           
 
Constructor Summary
BuiltinHelper()
           
 
Method Summary
static java.lang.String getFileName(java.io.File file)
          Returns file name.
static java.lang.String getLocatorLinks(java.io.File requestFile)
          Returns locator links for all segments of the file path.
static java.lang.String getLocatorLinks(java.lang.String path)
          Returns locator links for all segments of the file path.
 java.lang.String validateLocalRequest()
          Checks if the request comes from localhost.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_BROWSER_LINK_PREFIX

public static final java.lang.String FILE_BROWSER_LINK_PREFIX
See Also:
Constant Field Values

FILE_BROWSER_LINK_PREFIX_DIR

public static final java.lang.String FILE_BROWSER_LINK_PREFIX_DIR
See Also:
Constant Field Values

FILE_BROWSER_LINK_PREFIX_FILE

public static final java.lang.String FILE_BROWSER_LINK_PREFIX_FILE
See Also:
Constant Field Values

FILE_BROWSER_LINK_ROOT

public static final java.lang.String FILE_BROWSER_LINK_ROOT
See Also:
Constant Field Values
Constructor Detail

BuiltinHelper

public BuiltinHelper()
Method Detail

validateLocalRequest

public java.lang.String validateLocalRequest()
Checks if the request comes from localhost. Currently only local requests are valid.

Returns:
true if the request is valid.

getLocatorLinks

public static java.lang.String getLocatorLinks(java.lang.String path)
Returns locator links for all segments of the file path.

Parameters:
path - The requested file path
Returns:
locator links

getLocatorLinks

public static java.lang.String getLocatorLinks(java.io.File requestFile)
Returns locator links for all segments of the file path.

Parameters:
requestFile - The requested file
Returns:
locator links

getFileName

public static java.lang.String getFileName(java.io.File file)
Returns file name.

Parameters:
file - the file
Returns:
name of the file