com.atlassian.bamboo.util
Class BambooFileUtils

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

public class BambooFileUtils
extends java.lang.Object


Method Summary
static boolean contains(java.io.File file, java.util.regex.Pattern pattern)
          This method checks whether given pattern occurs in a file.
static boolean containsRegex(java.io.File file, java.lang.String regexToMatch)
          Convenience method.
static java.io.File createTempDirectory(java.lang.Object client)
           
static java.io.File createTempDirectory(java.lang.String prefix)
           
static boolean isDirectoryImportant(java.io.File planSourceDirectory)
          Checks a path against a defined list of directories to see if it is important (and should not be deleted)
static java.lang.String pathFromComponents(java.lang.String[] pathComponents)
           
static java.util.List<java.lang.String> splitPathToComponents(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDirectoryImportant

public static boolean isDirectoryImportant(java.io.File planSourceDirectory)
Checks a path against a defined list of directories to see if it is important (and should not be deleted)

Parameters:
planSourceDirectory -
Returns:
important

createTempDirectory

public static java.io.File createTempDirectory(@NotNull
                                               java.lang.Object client)
                                        throws java.io.IOException
Throws:
java.io.IOException

createTempDirectory

public static java.io.File createTempDirectory(@NotNull
                                               java.lang.String prefix)
                                        throws java.io.IOException
Throws:
java.io.IOException

splitPathToComponents

@NotNull
public static java.util.List<java.lang.String> splitPathToComponents(@NotNull
                                                                             java.lang.String path)

pathFromComponents

@NotNull
public static java.lang.String pathFromComponents(@NotNull
                                                          java.lang.String[] pathComponents)

contains

public static boolean contains(java.io.File file,
                               java.util.regex.Pattern pattern)
                        throws java.io.IOException
This method checks whether given pattern occurs in a file. Empty pattern is always found. File is assumed to be UTF8. Malformed, non-utf character sequences will be ignored.

Parameters:
file - the file to check
pattern - the pattern to search for
Returns:
true if pattern is found
Throws:
java.io.IOException - in case of file access problems

containsRegex

public static boolean containsRegex(@NotNull
                                    java.io.File file,
                                    @NotNull
                                    java.lang.String regexToMatch)
                             throws java.io.IOException
Convenience method.

Throws:
java.io.IOException
See Also:
contains(File, Pattern)


Copyright © 2010 Atlassian. All Rights Reserved.