org.moremotion.util
Class FileUtils

java.lang.Object
  extended by org.moremotion.util.FileUtils

public class FileUtils
extends java.lang.Object

This class provides static utility methods to access MoreMotion specific files.

Version:
$Id: FileUtils.java 51 2008-03-10 11:46:54Z erkan $

Constructor Summary
FileUtils()
           
 
Method Summary
static java.lang.String getCurrentPageVariant(MoreMotionRequest request)
          Returns current page variant.
static java.io.File getPageConfigFile(MoreMotionRequest request, java.lang.String page, java.lang.String variant)
           
static java.io.File getPageFile(MoreMotionRequest request, java.lang.String page, java.lang.String variant)
          Returns the file associated with the given page name.
static void setCurrentPageVariant(MoreMotionRequest request, java.lang.String variant)
          Sets current page variant
static java.lang.String[] splitByExtension(java.lang.String filename)
          Splits a file name into two parts extension and the part before the extension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

getPageFile

public static java.io.File getPageFile(MoreMotionRequest request,
                                       java.lang.String page,
                                       java.lang.String variant)
Returns the file associated with the given page name. If variant parameter is not null and the variant file exits then it is returned. If variant file missing and the base file exists then the base file is returned. Otherwise false is returned.

Parameters:
request - The MoreMotionRequest object
page - The page name
variant - The page variant.

getPageConfigFile

public static java.io.File getPageConfigFile(MoreMotionRequest request,
                                             java.lang.String page,
                                             java.lang.String variant)

splitByExtension

public static java.lang.String[] splitByExtension(java.lang.String filename)
Splits a file name into two parts extension and the part before the extension.

Parameters:
filename - File name.
Returns:
String array. First element of the array contains the part before the extension Second element contains the extension.

getCurrentPageVariant

public static java.lang.String getCurrentPageVariant(MoreMotionRequest request)
Returns current page variant.


setCurrentPageVariant

public static void setCurrentPageVariant(MoreMotionRequest request,
                                         java.lang.String variant)
Sets current page variant



Copyright © 2002-2008 MOR YAZILIM. All Rights Reserved.