org.axway.grapes.commons.utils
Class FileUtils

java.lang.Object
  extended by org.axway.grapes.commons.utils.FileUtils

public final class FileUtils
extends Object

FileUtils

Provides generic methods


Method Summary
static Long getSize(File file)
          Get file size
static String read(File file)
          Reads a file and returns the result in a String
static void serialize(File folder, String content, String fileName)
          Serialize a content into a targeted file, checking that the parent directory exists.
static void touch(File folder, String fileName)
          Creates a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

serialize

public static void serialize(File folder,
                             String content,
                             String fileName)
                      throws IOException
Serialize a content into a targeted file, checking that the parent directory exists.

Parameters:
folder - File
content - String
fileName - String
Throws:
IOException

read

public static String read(File file)
                   throws IOException
Reads a file and returns the result in a String

Parameters:
file - File
Returns:
String
Throws:
IOException

getSize

public static Long getSize(File file)
Get file size

Returns:
Long

touch

public static void touch(File folder,
                         String fileName)
                  throws IOException
Creates a file

Parameters:
folder - File
fileName - String
Throws:
IOException


Copyright © 2014. All Rights Reserved.