com.atlassian.browsers
Class Utils

java.lang.Object
  extended by com.atlassian.browsers.Utils

public class Utils
extends java.lang.Object

Utilities used by the BrowserAutoInstaller


Method Summary
static java.io.File extractZip(java.io.File destDir, java.lang.String internalPath)
          Will extract a zip file given by the internal path into the destination dir given
static java.io.File findFile(java.io.File in, java.lang.String file, boolean exactMatch)
          Recursively searches for a file in a given path.
static void make755(java.io.File file)
          runs "chmod 755 " on the specified File
static boolean resourceExists(java.lang.String path)
          Checks that a resource exists for the given path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

make755

public static void make755(java.io.File file)
                    throws java.io.IOException
runs "chmod 755 " on the specified File

Throws:
java.io.IOException

findFile

public static java.io.File findFile(java.io.File in,
                                    java.lang.String file,
                                    boolean exactMatch)
                             throws java.io.IOException
Recursively searches for a file in a given path.

Parameters:
in - the path to look in
file - the file name to look for
exactMatch - whether the filename must equal or contain the file name you are looking for
Returns:
Throws:
java.io.IOException

resourceExists

public static boolean resourceExists(java.lang.String path)
Checks that a resource exists for the given path.

Parameters:
path - the path to check
Returns:
true if the resource at the given path exists

extractZip

public static java.io.File extractZip(java.io.File destDir,
                                      java.lang.String internalPath)
                               throws java.io.IOException
Will extract a zip file given by the internal path into the destination dir given

Parameters:
destDir - The File indicating the directory to unzip the file into. This will become the parent directory.
internalPath - The path to the zip file.
Returns:
The directory that the zip file was extracted into.
Throws:
java.io.IOException


Copyright © 2011 Atlassian. All Rights Reserved.