|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.frame4j.util.App
de.frame4j.UCopy
@MinDoc(copyright="Copyright 1997 - 2003, 2005, 2009 A. Weinert",
author="Albrecht Weinert",
version="V.55",
lastModified="28.07.2010",
lastModifiedBy="A. Weinert",
usage="start as Java application (-? for help)",
purpose="copy file or URL to file")
public class UCopy
Copy from file or URL to file.
This application copies from a file or an URL to an output file or to
normal output. The source specification is understood as URL (e.g.
"http://www.xyz.de/applets/t.class")
and as file (e.g.
"D:/uhu/tmp/edwin/t.class"), treating both (comfortably) as
equal (at command line / script level). File specifications will be
used with the "correct" file separator (see
ComVar.FS).
If the destination is a directory the source's filename will be
used.
This tool fetches files from Internet, the download of which by
"save link as" most browsers deny or not even offer, like e.g.
the .class or .jar of Applets.
To get files from the net an authentication (name, password) may be
provided as well as proxy settings. Like with all Frame4J's
(App inheritors) applications this may be done by command line or
— with more comfort — by providing an extra .properties
file.
On copying to a destination file the source's last modification date will
be transfered (when possible) as the date of the copying usually being
irrelevant.
The copying process is binary by default (byte by byte; one to one).
If different encodings are specified for source and destination two
transformations to and from Unicode are inserted. The same applies if text
transformations are ordered. In these cases only, source and destination
file may be the same. This is ordered by just omitting the destination
parameter.
Use cases for changing the the file encoding in situ are compilers that
insist in just one source file encoding no matter
which the platform and all other tools use and the platform independent
deployment of text files in archives (like .properties in .jar).
The example of changing of a file's text encoding shows that the copy
process by this tool is a good place for any sort of text manipulation.
Those may be implemented by extending this class and just overriding the
method manipContent(String) that will be intervened between
reading and writing if textManip is not empty. If it is
"eclipseDictionary" this class's implementation of
manipContent(String) will
UCopy belongs (as integral part)
a .properties file named
UCopy.properties.
It's part of the documentation.
| Field Summary | |
|---|---|
String |
destination
Name of destination file or directory. |
String |
inEncoding
The input's (text) encoding. |
String |
name
User name with password (name:passw). |
String |
outEncoding
The output's (text) encoding. |
String |
proxyHost
Name of the proxy server. |
String |
proxyPort
Port of the proxy server.. |
boolean |
proxySet
Use a proxy server when reading from URLs. |
String |
source
Name of source file or source URL. |
String |
textManip
Denomination of a text manipulation to be done while copying. |
| Fields inherited from class de.frame4j.util.App |
|---|
ano, appBase, appIO, appStartTime, args, bgColor, err, fullClassName, help, icon, INIT_ERROR, jmxRemoteNote, JOB_DONE_OK, log, LOG_OUT_ERROR, MAIN_THREAD_EXC, mainThread, myClass, myFrame, NO_PARS_ERROR, objectName, out, outMode, packName, prop, retCode, runFlag, shortClassName, title, verbose, verbosity |
| Fields inherited from interface de.frame4j.net.AttrSettable |
|---|
ILLEGAL_TYPE, ILLEGAL_VALUE, NO_ATTRIBUTE, NO_KNOWN_ATTRIBUTE, NO_VALUE, OK |
| Constructor Summary | |
|---|---|
UCopy()
|
|
| Method Summary | |
|---|---|
int |
doIt()
Working method of UCopy. |
static void |
main(String[] args)
Start method of UCopy. |
protected String |
manipContent(String content)
Optional text manipulation method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public String source
public String destination
public String textManip
manipContent(String),
inEncoding,
outEncodingpublic boolean proxySet
proxyHost and
proxyHost take effect.
public String proxyHost
proxySetpublic String proxyPort
proxySetpublic String name
public String inEncoding
public String outEncoding
| Constructor Detail |
|---|
public UCopy()
| Method Detail |
|---|
public static void main(String[] args)
args - command line argumentsdoIt(),
App.go(String[], boolean)protected String manipContent(String content)
textManip is not empty this method is called
between reading and writing the text content. It may do any optional
content manipulation.textManip is "eclipseDictionary".textManip this implementation will
return the content unchanged.
content - the original text content, null will return the
empty String, no matter what textManip sayspublic int doIt()
doIt in class Appmain(String[]),
App.go(String[], boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||