JBoss AS7 Deployment Plugin 7.9.Final

org.jboss.as.plugin.common
Class Files

java.lang.Object
  extended by org.jboss.as.plugin.common.Files

public class Files
extends Object

Utility for files.

Author:
James R. Perkins

Constructor Summary
Files()
           
 
Method Summary
static String createPath(boolean prependSeparator, String... paths)
           
static String createPath(File base, String... paths)
           
static String createPath(String... paths)
           
static void createPath(StringBuilder sb, String... paths)
           
static boolean deleteRecursively(File dir)
           
static File dropExtension(File file)
          Returns a new file with the extension dropped.
static String getExtension(File file)
          Returns the extension of the file or an empty string if no extension is found.
static void unzip(File zipFile, File targetDir)
          Unzips the zip file to the target directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Files

public Files()
Method Detail

createPath

public static String createPath(String... paths)

createPath

public static String createPath(File base,
                                String... paths)

createPath

public static String createPath(boolean prependSeparator,
                                String... paths)

getExtension

public static String getExtension(File file)
Returns the extension of the file or an empty string if no extension is found.

Parameters:
file - the file to find the extension of
Returns:
the extension or an empty string

dropExtension

public static File dropExtension(File file)
Returns a new file with the extension dropped. If no extension was found, the argument is returned.

Parameters:
file - the file to drop the extension for
Returns:
a new file with the extension dropped

deleteRecursively

public static boolean deleteRecursively(File dir)

unzip

public static void unzip(File zipFile,
                         File targetDir)
                  throws IOException
Unzips the zip file to the target directory.

Parameters:
zipFile - the zip file to unzip
targetDir - the directory to extract the zip file to
Throws:
IOException - if an I/O error occurs

createPath

public static void createPath(StringBuilder sb,
                              String... paths)

JBoss AS7 Deployment Plugin 7.9.Final

Copyright © 2016 JBoss by Red Hat. All Rights Reserved.