From: Jeff M. <cus...@us...> - 2003-08-11 09:16:33
|
Update of /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io In directory sc8-pr-cvs1:/tmp/cvs-serv19213/src/jdk/common/alt/java/io Modified Files: IOFactory.java IOFactoryImpl.java Log Message: Added mkdir for MockFile Index: IOFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io/IOFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- IOFactory.java 25 Jun 2003 09:22:29 -0000 1.2 +++ IOFactory.java 11 Aug 2003 09:16:30 -0000 1.3 @@ -1,12 +1,15 @@ package alt.java.io; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Writer; +import java.io.*; +import java.net.URL; +import java.net.URLConnection; public interface IOFactory { InputStream createInputStream(File aFile) throws FileNotFoundException; + + URLConnection createConnection(URL aURL) throws IOException; + + InputStream createInputStream(URLConnection connection) throws IOException; OutputStream createOutputStream(File aFile) throws FileNotFoundException; Index: IOFactoryImpl.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/jdk/common/alt/java/io/IOFactoryImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- IOFactoryImpl.java 25 Jun 2003 09:22:29 -0000 1.2 +++ IOFactoryImpl.java 11 Aug 2003 09:16:30 -0000 1.3 @@ -1,16 +1,25 @@ package alt.java.io; import java.io.*; +import java.net.URL; +import java.net.URLConnection; public class IOFactoryImpl implements IOFactory { public InputStream createInputStream(File aFile) throws FileNotFoundException { return new FileInputStream(aFile.getRealFile()); } + public URLConnection createConnection(URL aURL) throws IOException { + return aURL.openConnection(); + } + + public InputStream createInputStream(URLConnection connection) throws IOException { + return connection.getInputStream(); + } + public OutputStream createOutputStream(File aFile) throws FileNotFoundException { return new FileOutputStream(aFile.getRealFile()); } - public File createFile(String fileName) { return new FileImpl(fileName); } |