ch.qos.logback.core.util
Class FileUtil

java.lang.Object
  extended by ch.qos.logback.core.util.FileUtil

public class FileUtil
extends Object


Constructor Summary
FileUtil()
           
 
Method Summary
static boolean createMissingParentDirectories(File file)
           
static URL fileToURL(File file)
           
static boolean isParentDirectoryCreationRequired(File file)
           
static String prefixRelativePath(String prefix, String path)
          Prepends a string to a path if the path is relative.
static String resourceAsString(ContextAware ca, ClassLoader classLoader, String resourceName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

fileToURL

public static URL fileToURL(File file)

isParentDirectoryCreationRequired

public static boolean isParentDirectoryCreationRequired(File file)

createMissingParentDirectories

public static boolean createMissingParentDirectories(File file)

resourceAsString

public static String resourceAsString(ContextAware ca,
                                      ClassLoader classLoader,
                                      String resourceName)

prefixRelativePath

public static String prefixRelativePath(String prefix,
                                        String path)
Prepends a string to a path if the path is relative. If the path is already absolute, the same path is returned (nothing changed). This is useful for converting relative paths to absolute ones, given the absolute directory path as a prefix.

Parameters:
prefix - string to prepend to the evaluated path if it's not already absolute
path - path to evaluate
Returns:
path (prefixed if relative)


Copyright © 2005-2013 QOS.ch. All Rights Reserved.