Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Smart XCopy

Thread view: 
Roedy Green - 12 Jan 2006 06:33 GMT
Is there a utility around, preferably with Java source, that is like
XCOPY to copy directory trees, or just the *.java files in a directory
tree to matching tree with this wrinkle.

It suppresses the copy of the target file is already identical. E.g.
It does not copy unless the target in older or does not exist.

It should create new directories as needed.

4NT copy has a /U option, but the /S option does not work for
wildcards.  XCOPY itself has no /U option.

If someone wants to write one, they could use FileTransfer
http://mindprod.com/products1.html#FILETRANSFER to do the copies. I
have some code to show how you scan the tree recursively.

The hard part is parsing the command line and it various
abbreviations.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andy - 12 Jan 2006 09:16 GMT
> Is there a utility around, preferably with Java source, that is like
> XCOPY to copy directory trees, or just the *.java files in a directory
> tree to matching tree with this wrinkle.

This is the sort of thing Ant does very well.
Thomas Weidenfeller - 12 Jan 2006 09:21 GMT
> Is there a utility around, preferably with Java source, that is like
> XCOPY to copy directory trees, or just the *.java files in a directory
> tree to matching tree with this wrinkle.
>
> It suppresses the copy of the target file is already identical. E.g.
> It does not copy unless the target in older or does not exist.

rsync (didn't we already discuss this some time ago?). Works not only
remotely, but also for local files. But it's C, not Java.

Since you are a Windows guy, you probably want the Cygwin version
http://www.cygwin.com/ Unix/Linux people often get it with their OS.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

David Segall - 12 Jan 2006 11:17 GMT
>Is there a utility around, preferably with Java source, that is like
>XCOPY to copy directory trees, or just the *.java files in a directory
[quoted text clipped - 14 lines]
>The hard part is parsing the command line and it various
>abbreviations.
The fact that you specified XCOPY allows me to assume that you are
talking about Windows.

Microsoft's Robocopy, which is part of the Windows Server 2003
Resource Kit Tools, has so many options it is unlikely that there is
not a combination that will do what you want. It works with XP and
probably previous derivatives of NT. It is a free download from here -
<http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee
-b18c4790cffd&DisplayLang=en
>
Sorry, it does not come with Java source.
Luc The Perverse - 12 Jan 2006 22:11 GMT
> Is there a utility around, preferably with Java source, that is like
> XCOPY to copy directory trees, or just the *.java files in a directory
[quoted text clipped - 14 lines]
> The hard part is parsing the command line and it various
> abbreviations.

I was going to create something similar for creating backups, but it was
going to work off checksums and filesizes.  But it was going to be a GUI
app.   Making a console app might make more sense.

But I don't see what you mean is difficult about "various abbreviations".
Paths and relative paths should be easily passed into the system and the
only thing you would need worry about would be wild cards right?

Signature

LTP

:)
Roedy Green - 12 Jan 2006 23:26 GMT
On Thu, 12 Jan 2006 15:11:33 -0700, "Luc The Perverse"
<sll_noSpamlicious_z_XXX_m@cc.usu.edu> wrote, quoted or indirectly
quoted someone who said :

>But I don't see what you mean is difficult about "various abbreviations".
>Paths and relative paths should be easily passed into the system and the
>only thing you would need worry about would be wild cards right?

Think of DOS copy.  you can leave off various combinations of  drive,
directory, filename on source and target, filling in defaults from the
CWD.  You might have wildcards of various flavours, possibly multiple
wildcards, The target directories may not exist.

You may have URLS instead of filenames.

Just copying one fully qualified filename to another is the least of
your problems.  FileTransfer does that for you.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Luc The Perverse - 13 Jan 2006 00:44 GMT
> On Thu, 12 Jan 2006 15:11:33 -0700, "Luc The Perverse"
> <sll_noSpamlicious_z_XXX_m@cc.usu.edu> wrote, quoted or indirectly
[quoted text clipped - 10 lines]
>
> You may have URLS instead of filenames.

Maybe I have just never tried it - it just doesn't seem like it would be
that hard.   Of course, I am often suprised.

> Just copying one fully qualified filename to another is the least of
> your problems.  FileTransfer does that for you.

Will FileTransfer transfer to an FTP server?    I the product listed but not
an explanation

I need to find a way to send from one Java client directly to another Java
client for the project I was talking about making.

GTGE is so much fun that the only thing I've been doing with Java is making
games instead of actually trying to make some projects which might have some
practical use.

--
LTP

:)
Roedy Green - 13 Jan 2006 02:11 GMT
On Thu, 12 Jan 2006 17:44:40 -0700, "Luc The Perverse"
<sll_noSpamlicious_z_XXX_m@cc.usu.edu> wrote, quoted or indirectly
quoted someone who said :

>Will FileTransfer transfer to an FTP server?    I the product listed but not
>an explanation

Filetransfer does not speak FTP. It will do  a GET of a file from an
HTTP server though.  It can read and write Input and Output Streams
you set up. It will copy to and from files. Basically it just handles
the chunking logic for you and dealing with reads that don't hand over
as many bites and requested.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.