Package org.djutils.io
Class URLResourceTest
java.lang.Object
org.djutils.io.URLResourceTest
public class URLResourceTest extends Object
URLResourceTest.java.
Copyright (c) 2002-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
- Author:
- Alexander Verbraeck
-
Constructor Summary
Constructors Constructor Description URLResourceTest()
-
Method Summary
Modifier and Type Method Description void
addToJarFile(String fileName, JarOutputStream jos)
Copy a plain file into a jar file.void
fileTest()
Test whether URLResource retrieves files.void
jarTest()
Test whether URLResource retrieves files.void
resourceAsStreamTest()
Test whether URLResource retrieves files.void
resourceTest()
Test whether URLResource retrieves files.
-
Constructor Details
-
URLResourceTest
public URLResourceTest()
-
-
Method Details
-
fileTest
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O error
-
resourceTest
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O errorURISyntaxException
- on URL error
-
resourceAsStreamTest
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O errorURISyntaxException
- on URL error
-
jarTest
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O errorURISyntaxException
- on error
-
addToJarFile
public void addToJarFile(String fileName, JarOutputStream jos) throws FileNotFoundException, IOExceptionCopy a plain file into a jar file.- Parameters:
fileName
- String; name of the file to copyjos
- JarOutputStream; stream for writing into the jar file- Throws:
FileNotFoundException
- when the input file could not be foundIOException
- when the input file could not be read, or writing to the jar stream fails
-