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/19 15:50:20 UTC
svn commit: r826670 - in
/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io:
Device.java Streamable.java
Author: mturk
Date: Mon Oct 19 13:50:20 2009
New Revision: 826670
URL: http://svn.apache.org/viewvc?rev=826670&view=rev
Log:
Split Streamable to Device
Added:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Device.java (with props)
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Streamable.java
Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Device.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Device.java?rev=826670&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Device.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Device.java Mon Oct 19 13:50:20 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.commons.runtime.io;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+/**
+ * The base class for all devices.
+ */
+public interface Device extends Closeable
+{
+
+ /**
+ * Test if {@code this} device is valid.
+ *
+ * @return {@code true} if the device represents a valid,
+ * open file, socket, or other I/O object; {@code false} otherwise.
+ *
+ */
+ public boolean valid();
+
+ /**
+ * Test wather or not every I/O operation on {@code this} device will
+ * block until it completes.
+ *
+ * @return {@code true} if, and only if, this device
+ * is in blocking mode.
+ *
+ * @throws IOException if an I/O error occurs.
+ */
+ public boolean isBlocking()
+ throws IOException;
+
+}
Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Device.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Streamable.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Streamable.java?rev=826670&r1=826669&r2=826670&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Streamable.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/Streamable.java Mon Oct 19 13:50:20 2009
@@ -18,13 +18,12 @@
package org.apache.commons.runtime.io;
-import java.io.Closeable;
import java.io.IOException;
/**
* The base class for bidirectional streams.
*/
-public interface Streamable extends Closeable
+public interface Streamable extends Device
{
/**
@@ -40,13 +39,4 @@
public boolean eof()
throws IOException;
- /**
- * Test if {@code this} stream is valid.
- *
- * @return {@code true} if the stream represents a valid,
- * open file, socket, or other I/O object; {@code false} otherwise.
- *
- */
- public boolean valid();
-
}