Browse Source

Add mkdir feature (no comment only)

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272898 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 23 years ago
parent
commit
fbdfb17427
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      proposal/sandbox/clearcase/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCUtils.java

+ 14
- 3
proposal/sandbox/clearcase/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCUtils.java View File

@@ -67,7 +67,6 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.util.regexp.RegexpMatcher;
import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
import org.apache.tools.ant.util.StringUtils;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
@@ -117,7 +116,7 @@ public final class CCUtils {
* @return the resolved link if it is a symbolic link, otherwise
* return the original link.
*/
public File resolveSymbolicLink(File toresolve) throws Exception {
public File resolveSymbolicLink(File toresolve) throws BuildException {
String[] args = { "ls", "-l", toresolve.getAbsolutePath() };
CmdResult res = cleartool(args);
if (res.getStatus() != 0 ){
@@ -139,7 +138,7 @@ public final class CCUtils {
/**
* Move a file to another. (ie rename)
*/
public void move(File from, File to) throws Exception {
public void move(File from, File to) throws BuildException {
String[] args = {"move", "-nc", from.getPath(), to.getPath()};
CmdResult res = cleartool(args);
if (res.getStatus() != 0) {
@@ -244,6 +243,18 @@ public final class CCUtils {
}
}

public void mkdir(File file, String comment) {

}

public void mkdir(File file){
String[] args = {"mkdir", "-nc", file.getAbsolutePath() };
CmdResult res = cleartool(args);
if (res.getStatus() != 0){
throw new BuildException(res.getStdErr());
}
}

/**
* Helper method to execute a given cleartool command.
* @param args the parameters used to execute cleartool.


Loading…
Cancel
Save