summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authormwebster <mwebster>2006-06-15 12:58:38 +0000
committermwebster <mwebster>2006-06-15 12:58:38 +0000
commit81abede5115df2b032b846c5ff8bf23050f68e34 (patch)
treefc8b9972315fc1dce4eecf8d630183eb95433e77 /util
parentf4cd0bfb01911ae5f8aaf4a114fac0b921806f50 (diff)
downloadaspectj-81abede5115df2b032b846c5ff8bf23050f68e34.tar.gz
aspectj-81abede5115df2b032b846c5ff8bf23050f68e34.zip
Fix build: move createEmptySandbox() from FileUtil back to Ajc to avoid JUnit dependency problem in util project
Diffstat (limited to 'util')
-rw-r--r--util/src/org/aspectj/util/FileUtil.java83
-rw-r--r--util/testsrc/org/aspectj/util/FileUtilTest.java5
2 files changed, 4 insertions, 84 deletions
diff --git a/util/src/org/aspectj/util/FileUtil.java b/util/src/org/aspectj/util/FileUtil.java
index 3e5b9ee4c..d7892f6eb 100644
--- a/util/src/org/aspectj/util/FileUtil.java
+++ b/util/src/org/aspectj/util/FileUtil.java
@@ -13,40 +13,10 @@
package org.aspectj.util;
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.Writer;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipInputStream;
-
-import junit.framework.AssertionFailedError;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.zip.*;
/**
@@ -1356,8 +1326,6 @@ public class FileUtil {
}
}
- private static final String SANDBOX_NAME = "ajcSandbox";
-
private FileUtil() { throw new Error("utility class"); }
public static List makeClasspath(URL[] urls) {
@@ -1541,47 +1509,4 @@ public class FileUtil {
}
}
- public static File createEmptySandbox() {
- File sandbox;
-
- String os = System.getProperty("os.name");
- File tempDir = null;
- // AMC - I did this rather than use the JDK default as I hate having to go look
- // in c:\documents and settings\......... for the results of a failed test.
- if (os.startsWith("Windows")) {
- tempDir = new File("C:\\temp");
- if (!tempDir.exists()) {tempDir.mkdir();}
- } else {
- tempDir = new File("/tmp");
- }
- File sandboxRoot = new File(tempDir,SANDBOX_NAME);
- if (!sandboxRoot.exists()) {
- sandboxRoot.mkdir();
- }
-
-
- try {
- File workspace = new File(".." + File.separator);
- String workspaceName = workspace.getCanonicalPath();
- int index = workspaceName.lastIndexOf(File.separator);
- workspaceName = workspaceName.substring(index+1);
-
- File workspaceRoot = new File(sandboxRoot,workspaceName);
- if (!workspaceRoot.exists()) {
- workspaceRoot.mkdir();
- }
-
- deleteContents(workspaceRoot);
-
- sandbox = File.createTempFile("ajcTest",".tmp",workspaceRoot);
- sandbox.delete();
- sandbox.mkdir();
-
- } catch (IOException ioEx) {
- throw new AssertionFailedError("Unable to create sandbox directory for test");
- }
-
- return sandbox;
- }
-
}
diff --git a/util/testsrc/org/aspectj/util/FileUtilTest.java b/util/testsrc/org/aspectj/util/FileUtilTest.java
index 1879abef7..23ac0e31f 100644
--- a/util/testsrc/org/aspectj/util/FileUtilTest.java
+++ b/util/testsrc/org/aspectj/util/FileUtilTest.java
@@ -706,10 +706,5 @@ public class FileUtilTest extends TestCase {
assertTrue("written: " + pipe.totalWritten(), false);
}
}
-
- public void testCreateEmptySandbox () {
- File sandbox = FileUtil.createEmptySandbox();
- assertTrue("Sandbox does not exist",sandbox.exists());
- }
}