com.atlassian.bamboo.util
Class BambooFilenameUtils

java.lang.Object
  extended by com.atlassian.bamboo.util.BambooFilenameUtils

public class BambooFilenameUtils
extends java.lang.Object

Author:
Krystian Brazulewicz

Method Summary
static boolean doesPathFollowToParentDirectory(java.lang.String path)
          Test if path "escapes" current directory
static java.lang.String getScriptSuffix()
           
static com.atlassian.fugue.Either<java.lang.String,java.io.File> getShortWindowsPath(java.lang.String path)
          Returns a short 8.3 path for a given path.
static boolean isPathAbsolute(java.lang.String path)
          Test if path denotes absolute path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isPathAbsolute

public static boolean isPathAbsolute(java.lang.String path)
Test if path denotes absolute path

Parameters:
path - path to be verified
Returns:
true if path is absolute

doesPathFollowToParentDirectory

public static boolean doesPathFollowToParentDirectory(java.lang.String path)
Test if path "escapes" current directory

Parameters:
path - path to be verified
Returns:
true if path "escapes" current directory

getScriptSuffix

public static java.lang.String getScriptSuffix()
Returns:
script extension used on the current platform

getShortWindowsPath

public static com.atlassian.fugue.Either<java.lang.String,java.io.File> getShortWindowsPath(java.lang.String path)
Returns a short 8.3 path for a given path. If it's not possible, the parameter path is returned as is. Only converts the path on Windows. The input path has to exist. The method shells out to cmd, so you should cache the returned value. On systems other than Windows, it will only perform the existence check and just return the supplied path.

Parameters:
path - path to convert to 8.3
Returns:
converted path or an error message if the conversion was unsuccesful
Throws:
java.lang.IllegalArgumentException - if the input path does not exist


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.