You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by je...@apache.org on 2003/07/27 19:17:12 UTC
cvs commit: jakarta-commons-sandbox/io/src/java/org/apache/commons/io/output LockableFileWriter.java DemuxOutputStream.java
jeremias 2003/07/27 10:17:12
Modified: io/src/java/org/apache/commons/io/output
LockableFileWriter.java DemuxOutputStream.java
Log:
Correct license
Javadocs
Revision Changes Path
1.2 +54 -19 jakarta-commons-sandbox/io/src/java/org/apache/commons/io/output/LockableFileWriter.java
Index: LockableFileWriter.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/io/src/java/org/apache/commons/io/output/LockableFileWriter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LockableFileWriter.java 11 Nov 2002 19:34:02 -0000 1.1
+++ LockableFileWriter.java 27 Jul 2003 17:17:12 -0000 1.2
@@ -1,9 +1,7 @@
-package org.apache.commons.io.output;
-
/* ====================================================================
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -18,21 +16,21 @@
* the documentation and/or other materials provided with the
* distribution.
*
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
+ * 4. The names "The Jakarta Project", "Commons", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -52,16 +50,14 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- *
*/
-
+package org.apache.commons.io.output;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
-
/**
* FileWriter that will create and honor lock files to allow simple
* cross thread file lock handling. If <code>Writer</code> attributes
@@ -87,31 +83,67 @@
private boolean append = false;
+ /**
+ * Constructs a LockableFileWriter. If the file exists, it is overwritten.
+ * @param fileName file to write to
+ * @throws IOException in case of an I/O error
+ */
public LockableFileWriter(String fileName)
throws IOException {
this(fileName, false, null);
}
+ /**
+ * Constructs a LockableFileWriter.
+ * @param fileName file to write to
+ * @param append true if content should be appended (default is to overwrite).
+ * @throws IOException in case of an I/O error
+ */
public LockableFileWriter(String fileName, boolean append)
throws IOException {
this(fileName, append, null);
}
+ /**
+ * Constructs a LockableFileWriter.
+ * @param fileName file to write to
+ * @param append true if content should be appended (default is to overwrite).
+ * @param lockDir Specifies the directory in which the lock file should be held.
+ * @throws IOException in case of an I/O error
+ */
public LockableFileWriter(String fileName, boolean append, String lockDir)
throws IOException {
this(new File(fileName), append, lockDir);
}
+ /**
+ * Constructs a LockableFileWriter. If the file exists, it is overwritten.
+ * @param file file to write to
+ * @throws IOException in case of an I/O error
+ */
public LockableFileWriter(File file)
throws IOException {
this(file, false, null);
}
+ /**
+ * Constructs a LockableFileWriter.
+ * @param file file to write to
+ * @param append true if content should be appended (default is to overwrite).
+ * @throws IOException in case of an I/O error
+ */
public LockableFileWriter(File file, boolean append)
throws IOException {
this(file, append, null);
}
+ /**
+ * Constructs a LockableFileWriter.
+ * @param file file to write to
+ * @param append true if content should be appended (default is to overwrite).
+ * @param lockDir Specifies the directory in which the lock file should be held.
+ * @throws IOException in case of an I/O error
+ */
public LockableFileWriter(File file, boolean append, String lockDir)
throws IOException {
this.append = append;
@@ -149,6 +181,7 @@
}
}
+ /** @see java.io.Writer#close() */
public void close()
throws IOException {
try {
@@ -158,11 +191,13 @@
}
}
+ /** @see java.io.Writer#write(char[], int, int) */
public void write(char[] cbuf, int off, int len)
throws IOException {
writer.write(cbuf, off, len);
}
+ /** @see java.io.Writer#flush() */
public void flush()
throws IOException {
writer.flush();
1.2 +16 -16 jakarta-commons-sandbox/io/src/java/org/apache/commons/io/output/DemuxOutputStream.java
Index: DemuxOutputStream.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/io/src/java/org/apache/commons/io/output/DemuxOutputStream.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DemuxOutputStream.java 11 Nov 2002 19:34:02 -0000 1.1
+++ DemuxOutputStream.java 27 Jul 2003 17:17:12 -0000 1.2
@@ -1,9 +1,7 @@
-package org.apache.commons.io.output;
-
/* ====================================================================
* The Apache Software License, Version 1.1
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -18,21 +16,21 @@
* the documentation and/or other materials provided with the
* distribution.
*
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
+ * 4. The names "The Jakarta Project", "Commons", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -53,6 +51,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
+package org.apache.commons.io.output;
import java.io.IOException;
import java.io.OutputStream;
@@ -73,6 +72,7 @@
* Bind the specified stream to the current thread.
*
* @param output the stream to bind
+ * @return the OutputStream that was previously active
*/
public OutputStream bindStream( final OutputStream output )
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org