Package org.djutils.io
Class URLResourceTest
- java.lang.Object
-
- org.djutils.io.URLResourceTest
-
public class URLResourceTest extends Object
URLResourceTest.java.Copyright (c) 2002-2021 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
All Methods Instance Methods Concrete Methods 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.
-
-
-
Method Detail
-
fileTest
public final void fileTest() throws IOException
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O error
-
resourceTest
public final void resourceTest() throws IOException, URISyntaxException
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O errorURISyntaxException
- on URL error
-
resourceAsStreamTest
public final void resourceAsStreamTest() throws IOException, URISyntaxException
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O errorURISyntaxException
- on URL error
-
jarTest
public final void jarTest() throws IOException, URISyntaxException
Test whether URLResource retrieves files.- Throws:
IOException
- on I/O errorURISyntaxException
- on error
-
addToJarFile
public void addToJarFile(String fileName, JarOutputStream jos) throws FileNotFoundException, IOException
Copy 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
-
-