|
@@ -102,6 +102,9 @@ public class PathConvert extends Task { |
|
|
|
|
|
|
|
|
private boolean preserveDuplicates; |
|
|
private boolean preserveDuplicates; |
|
|
|
|
|
|
|
|
|
|
|
/** Destination {@link Resource} */ |
|
|
|
|
|
private Resource dest; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Helper class, holds the nested <map> values. Elements will look like |
|
|
* Helper class, holds the nested <map> values. Elements will look like |
|
|
* this: <map from="d:" to="/foo"/> |
|
|
* this: <map from="d:" to="/foo"/> |
|
@@ -328,6 +331,19 @@ public class PathConvert extends Task { |
|
|
return refid != null; |
|
|
return refid != null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Set destination resource. |
|
|
|
|
|
* @param dest |
|
|
|
|
|
*/ |
|
|
|
|
|
public void setDest(Resource dest) { |
|
|
|
|
|
if (dest != null) { |
|
|
|
|
|
if (this.dest != null) { |
|
|
|
|
|
throw new BuildException("@dest already set"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.dest = dest; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Do the execution. |
|
|
* Do the execution. |
|
|
* @throws BuildException if something is invalid. |
|
|
* @throws BuildException if something is invalid. |
|
@@ -371,7 +387,10 @@ public class PathConvert extends Task { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private OutputStream createOutputStream() { |
|
|
|
|
|
|
|
|
private OutputStream createOutputStream() throws IOException { |
|
|
|
|
|
if (dest != null) { |
|
|
|
|
|
return dest.getOutputStream(); |
|
|
|
|
|
} |
|
|
if (property == null) { |
|
|
if (property == null) { |
|
|
return new LogOutputStream(this); |
|
|
return new LogOutputStream(this); |
|
|
} |
|
|
} |
|
@@ -452,10 +471,12 @@ public class PathConvert extends Task { |
|
|
* @throws BuildException if something is not set up properly. |
|
|
* @throws BuildException if something is not set up properly. |
|
|
*/ |
|
|
*/ |
|
|
private void validateSetup() throws BuildException { |
|
|
private void validateSetup() throws BuildException { |
|
|
|
|
|
|
|
|
if (path == null) { |
|
|
if (path == null) { |
|
|
throw new BuildException("You must specify a path to convert"); |
|
|
throw new BuildException("You must specify a path to convert"); |
|
|
} |
|
|
} |
|
|
|
|
|
if (property != null && dest != null) { |
|
|
|
|
|
throw new BuildException("@property and @dest are mutually exclusive"); |
|
|
|
|
|
} |
|
|
// Determine the separator strings. The dirsep and pathsep attributes |
|
|
// Determine the separator strings. The dirsep and pathsep attributes |
|
|
// override the targetOS settings. |
|
|
// override the targetOS settings. |
|
|
String dsep = File.separator; |
|
|
String dsep = File.separator; |
|
|