org.specs.io.fs

object fs

object fs

 extends FileSystem


The fs object offers a simple interface to the file system (see the description of the FileSystem trait)


Source: FileSystem.scala(11)

 Constructors

def this

 Methods

!= final def !=(arg0 : Any) Boolean Any
!= final def !=(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Any) Boolean Any
asInstanceOf final def asInstanceOf[T0] T0 Any
asList implicit def asList[T](v : Vector[T])
[details]
return
- the vector elements as a List
List[T] JavaConversions
canRead def canRead(path : String)
[details]
return
- true if the file can be read
Boolean FileSystem
canWrite def canWrite(path : String)
[details]
return
- true if the file can be written
Boolean FileSystem
clone protected def clone Object AnyRef
createDir def createDir(path : String)
creates a directory for a given path
Boolean FileSystem
createFile def createFile(path : String)
creates a file for a given path [details]
Create the parent directory if necessary
Boolean FileSystem
enumerationToList implicit def enumerationToList[T](e : Enumeration[T])
[details]
return
- the enumeration elements as a List
List[T] JavaConversions
eq final def eq(arg0 : Object) Boolean AnyRef
equals def equals(arg0 : Any) Boolean AnyRef
exists def exists(path : String)
[details]
return
- true if the file exists
Boolean FileSystem
filePaths def filePaths(path : String)
[details]
param
path - glob expression, for example: ./dir*.xml
return
- the list of paths represented by the "glob" definition path
List[String] FileSystem
finalize protected def finalize Unit AnyRef
getAbsolutePath def getAbsolutePath(path : String)
[details]
return
- the file absolute path
String FileSystem
getCanonicalPath def getCanonicalPath(path : String)
[details]
return
- the file canonical path
String FileSystem
getClass final def getClass Class[Object] AnyRef
getName def getName(path : String)
[details]
return
- the file name
String FileSystem
getParent def getParent(path : String)
[details]
return
- the file parent path
String FileSystem
getWriter def getWriter(path : String)
The getWriter function can be overriden to provide a mock writer writing to the console for example [details]
return
- a Writer object opened on the file designated by path
Writer FileWriter
globToPattern def globToPattern(glob : String)
[details]
return
- the regular expression equivalent to a glob pattern (see the specs for examples)
String FileSystem
hashCode def hashCode Int AnyRef
isAbsolute def isAbsolute(path : String)
[details]
return
- true if the file is absolute
Boolean FileSystem
isDir def isDir(path : String)
[details]
return
- true if the File represented by this path is a directory
Boolean FileSystem
isDirectory def isDirectory(path : String)
[details]
return
- true if the file is a directory
Boolean FileSystem
isFile def isFile(path : String)
[details]
return
- true if the file is a file
Boolean FileSystem
isHidden def isHidden(path : String)
[details]
return
- true if the file is hidden
Boolean FileSystem
isInstanceOf final def isInstanceOf[T0] Boolean Any
javaArrayToList implicit def javaArrayToList[T](array : Array[T])
[details]
return
- the array elements as a List
List[T] JavaConversions
listFiles def listFiles(path : String)
[details]
return
- the files of that directory
List[String] FileSystem
ne final def ne(arg0 : Object) Boolean AnyRef
notify final def notify Unit AnyRef
notifyAll final def notifyAll Unit AnyRef
readFile def readFile(path : String)
reads the content of a file [details]
param
path - the path of the file to read
return
- the content of the file at path
String FileReader
removeDir def removeDir(path : String)
deletes the directory and all directory contents at the specified path and return the parent path of that directory
String FileSystem
synchronized final def synchronized[T0](arg0 : T0) T0 AnyRef
toString def toString String AnyRef
wait final def wait(arg0 : Long) Unit AnyRef
wait final def wait Unit AnyRef
wait final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
write def write(path : String)(function : (Writer) => Unit)
writes some content to a file and take care of closing the file [details]

Usage:

   write("./dir/hello.txt") { out =>
     out.write("content")
   }
   
param
path - path of the file to read
Unit FileWriter
Copyright (c) 2007-2008. All Rights Reserved.