com.evanmclean.evlib.io
Class ReplacingFileCopier
java.lang.Object
com.evanmclean.evlib.io.ReplacingFileCopier
public class ReplacingFileCopier
- extends Object
Copies files, replacing tokens like "%token%" with the substitute
value. The token must start and end with the delimiter character (percent by
default).
- Author:
- Evan McLean McLean Computer Services (see the
overview for copyright and licensing.)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReplacingFileCopier
public ReplacingFileCopier()
ReplacingFileCopier
public ReplacingFileCopier(char delimiter)
clear
public void clear()
copy
public boolean copy(File from,
File to)
copy
public void copy(File from,
PrintWriter out)
throws IOException
- Throws:
IOException
copy
public void copy(File from,
Writer out)
throws IOException
- Throws:
IOException
entrySet
public Set<Map.Entry<String,String>> entrySet()
errorHandler
public void errorHandler(File from,
File to,
IOException exception)
- Can be overridden to handle errors.
- Parameters:
from
- to
- exception
-
getDelimiter
public char getDelimiter()
isEmpty
public boolean isEmpty()
isNoMatchError
public boolean isNoMatchError()
put
public String put(String key,
String value)
putAll
public void putAll(Map<? extends String,? extends String> map)
remove
public String remove(String key)
setDelimiter
public void setDelimiter(char delim)
setNoMatchError
public void setNoMatchError(boolean no_match_error)
size
public int size()