org.dbmaintain.util
Class FileUtils

java.lang.Object
  extended by org.dbmaintain.util.FileUtils

public class FileUtils
extends Object

Author:
Tim Ducheyne, Filip Neven

Constructor Summary
FileUtils()
           
 
Method Summary
static void createFile(File file, Reader contentReader)
          Creates a file and write the given content to it.
static void createFile(File file, String content)
          Creates a file and write the given content to it.
static URL getUrl(File file)
          Creates an URL that points to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

getUrl

public static URL getUrl(File file)
Creates an URL that points to the given file.

Parameters:
file - The file, not null
Returns:
The URL to the file, not null

createFile

public static void createFile(File file,
                              Reader contentReader)
                       throws IOException
Creates a file and write the given content to it. Note: the content reader is not closed.

Parameters:
file - The new file to create, not null
contentReader - The stream with the content for the file, not null
Throws:
IOException

createFile

public static void createFile(File file,
                              String content)
                       throws IOException
Creates a file and write the given content to it.

Parameters:
file - The new file to create, not null
content - The content for the file, not null
Throws:
IOException


Copyright © 2011. All Rights Reserved.