dlr 01/08/21 16:13:34
Modified: util/src/java/org/apache/commons/util
LockableFileWriter.java
Log:
Removd unused DIR_SEPARATOR constant and renamed fileName to file,
since that instance member is of type File.
Revision Changes Path
1.4 +15 -11
jakarta-commons-sandbox/util/src/java/org/apache/commons/util/LockableFileWriter.java
Index: LockableFileWriter.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/util/src/java/org/apache/commons/util/LockableFileWriter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- LockableFileWriter.java 2001/08/21 22:31:06 1.3
+++ LockableFileWriter.java 2001/08/21 23:13:34 1.4
@@ -65,18 +65,22 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Michael Salmon</a>
- * @version $Id: LockableFileWriter.java,v 1.3 2001/08/21 22:31:06 jon Exp $
+ * @version $Id: LockableFileWriter.java,v 1.4 2001/08/21 23:13:34 dlr Exp $
*/
public class LockableFileWriter extends Writer
{
- private File fileName = null;
- private static File lockDir = new File(System.getProperty("java.io.tmpdir"));
- private File lockFile = null;
private static final String LCK = ".lck";
+ private static File lockDir =
+ new File(System.getProperty("java.io.tmpdir"));
+
+ private File file = null;
+
+ private File lockFile = null;
+
private FileWriter writer = null;
+
private boolean append = false;
- private static final String DIR_SEPERATOR =
System.getProperty("file.seperator");
/**
* Write to a file. Uses java.io.tmpdir System property for the
@@ -102,7 +106,7 @@
throws IOException
{
this.append = append;
- this.fileName = new File(lockDir, fileName);
+ this.file = new File(lockDir, fileName);
init();
}
@@ -111,21 +115,21 @@
{
this.append = append;
this.lockDir = new File(lockDir);
- this.fileName = new File(lockDir, fileName);
+ this.file = new File(lockDir, fileName);
init();
}
public LockableFileWriter(File file)
throws IOException
{
- this.fileName = file;
+ this.file = file;
init();
}
public LockableFileWriter(File file, String lockDir)
throws IOException
{
- this.fileName = file;
+ this.file = file;
this.lockDir = new File(lockDir);
init();
}
@@ -134,9 +138,9 @@
throws IOException
{
testLockDir();
- this.lockFile = new File (lockDir, fileName.getName() + LCK);
+ this.lockFile = new File(lockDir, file.getName() + LCK);
createLock();
- this.writer = new FileWriter(fileName.getAbsolutePath(), this.append);
+ this.writer = new FileWriter(file.getAbsolutePath(), this.append);
}
private void testLockDir()