Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 64803 invoked from network); 23 Oct 2009 08:21:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Oct 2009 08:21:40 -0000 Received: (qmail 48192 invoked by uid 500); 23 Oct 2009 08:21:40 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 48100 invoked by uid 500); 23 Oct 2009 08:21:40 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 48091 invoked by uid 99); 23 Oct 2009 08:21:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Oct 2009 08:21:40 +0000 X-ASF-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Oct 2009 08:21:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5A54B2388909; Fri, 23 Oct 2009 08:21:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r828963 - /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileInstance.java Date: Fri, 23 Oct 2009 08:21:17 -0000 To: commits@commons.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091023082117.5A54B2388909@eris.apache.org> Author: mturk Date: Fri Oct 23 08:21:16 2009 New Revision: 828963 URL: http://svn.apache.org/viewvc?rev=828963&view=rev Log: See what to do with FileInstance Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileInstance.java 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=828963&r1=828962&r2=828963&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 23 08:21:16 2009 @@ -39,107 +39,4 @@ // No instance } - /** - * The "standard" input stream {@code FileStream}. - */ - public static final FileStream STDIN; - /** - * The "standard" output stream {@code FileStream}. - */ - public static final FileStream STDOUT; - /** - * The "standard" error stream {@code FileStream}. - */ - public static final FileStream STDERR; - - static { - /* Initialize the "standard" FileStream. - * Note that those descriptors can be NULL in - * case the FileStream.open call fails. - */ - STDIN = new FileStreamImpl(FileWrapper.open(0, null)); - STDOUT = new FileStreamImpl(FileWrapper.open(1, null)); - STDERR = new FileStreamImpl(FileWrapper.open(2, null)); - } - - /** - * Create new {@code FileStream} that is bound to the spacified standard - * I/O device (standard input, standard output, or standard error). - *

- * FileInstance returned can be used by applications that need to - * read from or write to the console. If the standard handle is redirected - * the returned {@code FileStream} is pointer to that redirected file. - *

- *

- * If the application doesn't have standard handles (e.g. daemon applicaton) - * and the handles are not redirected, the returned {@code FileStream} - * contains invalid file {@code Descriptor}. Any further operation on such - * {@code FileStream} will fail with {@link ClosedDescriptorException}. - *

- *

- * Parameter {@code which} determines which one of the stadard streams to - * open and can have the following values: - *

- *

-     * 0    "standard" input stream.
-     * 1    "standard" output stream.
-     * 2    "standard" error stream.
-     * 
- * @param which standard stream to open. - * - * @return new {@code FileStream} connected to standard stream. - * - */ - public static FileStream createStdStream(int which, - EnumSet mode) - throws IllegalArgumentException - { - if (which < 0 || which > 2) { - throw new IllegalArgumentException(); - } - Descriptor fd = FileWrapper.open(which, mode); - return new FileStreamImpl(fd); - } - - public static FileStream createStdStream(int which, - FileOpenMode... mode) - throws IllegalArgumentException - { - return createStdStream(which, FileOpenMode.of(mode)); - } - - /** - * Create new temporary file inside {@code directory}. - * - * @param prefix temporary file prefix. - * - * @return new temporary file {@code Descriptor}. - */ - public static Descriptor createTemp(String prefix, String suffix, - Path directory, boolean preserve) - throws IOException, IllegalArgumentException, SecurityException - { - if (prefix == null) { - throw new IllegalArgumentException(); - } - return FileWrapper.mktemp(directory, prefix, suffix, preserve); - } - - /** - * Create new temporary file inside current directory. - * - * @param prefix file prefix. - * - * @return new temporary file {@code Descriptor}. - */ - public static Descriptor createTemp(String prefix, String suffix, - boolean preserve) - throws IOException, IllegalArgumentException, SecurityException - { - if (prefix == null) { - throw new IllegalArgumentException(); - } - return FileWrapper.mktemp(prefix, suffix, preserve); - } - }