org.gcube.vremanagement.softwaregateway.impl.repositorymanager.maven
Class FileUtilsExtended

java.lang.Object
  extended by org.gcube.vremanagement.softwaregateway.impl.repositorymanager.maven.FileUtilsExtended

public class FileUtilsExtended
extends Object

Author:
Luca Frosini (ISTI-CNR)

Field Summary
protected static org.gcube.common.core.utils.logging.GCUBELog logger
          Class logger.
 
Constructor Summary
FileUtilsExtended()
           
 
Method Summary
static void copyFile(File source, File target)
          Copy the source file to the the target file
static String dateDirectory()
           
static String fileToString(String absolutePath)
           
static boolean recursiveDeleteDirectory(File directory)
          Remove Recursively a directory
static void stringToFile(String str, File targetFile)
           
static void writeXmlToFile(Document document, File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.gcube.common.core.utils.logging.GCUBELog logger
Class logger.

Constructor Detail

FileUtilsExtended

public FileUtilsExtended()
Method Detail

recursiveDeleteDirectory

public static boolean recursiveDeleteDirectory(File directory)
Remove Recursively a directory

Parameters:
directory - to remove
Returns:
true is the directory is successully removed

stringToFile

public static void stringToFile(String str,
                                File targetFile)
                         throws IOException
Parameters:
str - string
targetFile - Target File
Throws:
IOException - if fails

fileToString

public static String fileToString(String absolutePath)
                           throws Exception
Parameters:
absolutePath - of the File
Returns:
the string representation of the content of the File
Throws:
Exception - if fails

dateDirectory

public static String dateDirectory()
Returns:
string rapresentaton of the name of a directory in the format DD-MM-YYYY

writeXmlToFile

public static void writeXmlToFile(Document document,
                                  File file)
                           throws Exception
Parameters:
document - xml document
file - output file
Throws:
Exception - if fails

copyFile

public static void copyFile(File source,
                            File target)
                     throws Exception
Copy the source file to the the target file

Parameters:
source - source file
target - target file
Throws:
Exception - if fails


Copyright © 2013. All Rights Reserved.