You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/10/09 17:03:17 UTC
svn commit: r823574 - in
/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io:
File.java FileInstance.java FileLock.java FileWrapper.java
Author: mturk
Date: Fri Oct 9 15:03:16 2009
New Revision: 823574
URL: http://svn.apache.org/viewvc?rev=823574&view=rev
Log:
Make createTempFile with the same argument layout as original
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileInstance.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLock.java
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileWrapper.java
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java?rev=823574&r1=823573&r2=823574&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/File.java Fri Oct 9 15:03:16 2009
@@ -530,22 +530,21 @@
/**
* Create new temporary {@code FileInstance} inide {@code path}.
*
- * @param path directory abstract path.
* @param prefix temporary file prefix.
- * @param sufix temporary file sufix.
+ * @param suffix temporary file sufix.
+ * @param directory The directory in which the file is to be created.
* @param preserve if {@code true} do not delete file on {@code close}.
*
* @return new temporary {@code FileInstance}.
*/
- public static FileInstance createTempFile(File path, String prefix,
- String sufix, boolean preserve)
- throws FileNotFoundException, IOException, IllegalArgumentException,
- SecurityException
+ public static FileInstance createTempFile(String prefix, String suffix,
+ File directory, boolean preserve)
+ throws IOException, IllegalArgumentException, SecurityException
{
if (prefix == null) {
throw new IllegalArgumentException();
}
- Descriptor fd = FileWrapper.mktemp(path, prefix, sufix, preserve);
+ Descriptor fd = FileWrapper.mktemp(directory, prefix, suffix, preserve);
return new FileInstance(fd);
}
@@ -556,15 +555,14 @@
*
* @return new temporary {@code FileInstance}.
*/
- public static FileInstance createTempFile(String prefix, String sufix,
+ public static FileInstance createTempFile(String prefix, String suffix,
boolean preserve)
- throws FileNotFoundException, IOException, IllegalArgumentException,
- SecurityException
+ throws IOException, IllegalArgumentException, SecurityException
{
if (prefix == null) {
throw new IllegalArgumentException();
}
- Descriptor fd = FileWrapper.mktemp(prefix, sufix, preserve);
+ Descriptor fd = FileWrapper.mktemp(prefix, suffix, preserve);
return new FileInstance(fd);
}
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileInstance.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileInstance.java?rev=823574&r1=823573&r2=823574&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileInstance.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileInstance.java Fri Oct 9 15:03:16 2009
@@ -214,15 +214,14 @@
*
* @return new temporary {@code FileInstance}.
*/
- public static FileInstance createTemp(File path, String prefix,
- String sufix, boolean preserve)
- throws FileNotFoundException, IOException, IllegalArgumentException,
- SecurityException
+ public static FileInstance createTemp(String prefix, String suffix,
+ File directory, boolean preserve)
+ throws IOException, IllegalArgumentException, SecurityException
{
if (prefix == null) {
throw new IllegalArgumentException();
}
- Descriptor fd = FileWrapper.mktemp(path, prefix, sufix, preserve);
+ Descriptor fd = FileWrapper.mktemp(directory, prefix, suffix, preserve);
return new FileInstance(fd);
}
@@ -233,15 +232,14 @@
*
* @return new temporary {@code FileInstance}.
*/
- public static FileInstance createTemp(String prefix, String sufix,
+ public static FileInstance createTemp(String prefix, String suffix,
boolean preserve)
- throws FileNotFoundException, IOException, IllegalArgumentException,
- SecurityException
+ throws IOException, IllegalArgumentException, SecurityException
{
if (prefix == null) {
throw new IllegalArgumentException();
}
- Descriptor fd = FileWrapper.mktemp(prefix, sufix, preserve);
+ Descriptor fd = FileWrapper.mktemp(prefix, suffix, preserve);
return new FileInstance(fd);
}
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLock.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLock.java?rev=823574&r1=823573&r2=823574&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLock.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLock.java Fri Oct 9 15:03:16 2009
@@ -73,7 +73,7 @@
* Further care should be exercised when locking files maintained on network
* file systems, since they often have further limitations.
*/
-public class FileLock
+public final class FileLock
{
/*
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileWrapper.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileWrapper.java?rev=823574&r1=823573&r2=823574&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileWrapper.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileWrapper.java Fri Oct 9 15:03:16 2009
@@ -212,24 +212,24 @@
}
private static native Descriptor mktemp0(String path, String prefix,
- String sufix, boolean preserve)
- throws FileNotFoundException, IOException, SecurityException;
+ String suffix, boolean preserve)
+ throws IOException, SecurityException;
/**
* Create temp file Descriptor.
*
* @return create temp file descriptor.
* @throws IOException on error.
*/
- public static Descriptor mktemp(File path, String prefix, String sufix,
+ public static Descriptor mktemp(File path, String prefix, String suffix,
boolean preserve)
- throws FileNotFoundException, IOException, IllegalArgumentException,
+ throws IOException, IllegalArgumentException,
SecurityException
{
if (path == null) {
throw new IllegalArgumentException();
}
// Call the native method.
- return mktemp0(path.getPath(), prefix, sufix, preserve);
+ return mktemp0(path.getPath(), prefix, suffix, preserve);
}
/**
@@ -238,13 +238,13 @@
* @return create temp file descriptor.
* @throws IOException on error.
*/
- public static Descriptor mktemp(String prefix, String sufix,
+ public static Descriptor mktemp(String prefix, String suffix,
boolean preserve)
- throws FileNotFoundException, IOException, IllegalArgumentException,
+ throws IOException, IllegalArgumentException,
SecurityException
{
// Call the native method.
- return mktemp0(null, prefix, sufix, preserve);
+ return mktemp0(null, prefix, suffix, preserve);
}
private static native int lock0(int fd, int type)