Files

org.beangle.commons.io.Files
object Files

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Files.type

Members list

Value members

Concrete methods

def clear(file: File): Unit
def copy(srcFile: File, destFile: File): Unit

Copies a file to a new location preserving the file date.

Copies a file to a new location preserving the file date.

This method copies the contents of the specified source file to the specified destination file. The directory holding the destination file is created if it does not exist. If the destination file exists, then this method will overwrite it.

Note: This method tries to preserve the file's last modified date/times using [[File# setLastModified ( long )]], however it is not guaranteed that the operation will succeed. If the modification operation fails, no indication is provided.

Value parameters

destFile

the new file, must not be null

srcFile

an existing file to copy, must not be null

Attributes

def forName(name: String): File
def purify(name: String): String

过滤不适合作为文件名的特殊字符

过滤不适合作为文件名的特殊字符

Attributes

def readLines(file: File, charset: Charset): List[String]

Reads the contents of a file line by line to a List of Strings. The file is always closed.

Reads the contents of a file line by line to a List of Strings. The file is always closed.

Attributes

def readString(file: File, charset: Charset): String

Reads the contents of a file into a String. The file is always closed.

Reads the contents of a file into a String. The file is always closed.

Attributes

def remove(file: File): Unit
def setExecutable(file: File): Unit
def setReadOnly(file: File): Unit
def setWriteable(file: File): Unit
def stringWriter(file: File, charset: Charset): Writer
def touch(file: File): Unit
def travel(file: File, attributeSet: File => Unit): Unit
def writeOpen(file: File, append: Boolean): FileOutputStream
def writeString(file: File, data: String, charset: Charset): Unit

Writes a String to a file creating the file if it does not exist.

Writes a String to a file creating the file if it does not exist.

Attributes

Concrete fields

val /: String