Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ditto zip and BOMArchiveHelper, reassemble forks and metadata



Jeff McDonald wrote:

>StringBuilder dittoCommand = new StringBuilder();
>dittoCommand.append("ditto -cj --keepParent ");
>dittoCommand.append(sourceDirOrFile);
>dittoCommand.append("' '");
>dittoCommand.append(pathToEncodedFile);
>dittoCommand.append("'");

You neglected to handle embedded single-quotes in sourceDirOrFile and
pathToEncodedFile.

There are also other quoting errors in your code.

It's safer and simpler to construct a String[] to pass to exec(), rather
than trying to make the parameters quote-safe and then running a shell.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.