Package org.djutils.io
Class URLResourceTest
java.lang.Object
org.djutils.io.URLResourceTest
URLResourceTest.java.
Copyright (c) 2002-2024 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToJarFile
(String fileName, JarOutputStream jos) Copy a plain file into a jar file.final void
fileTest()
Test whether URLResource retrieves files.final void
jarTest()
Test whether URLResource retrieves files.final void
Test whether URLResource retrieves files.final void
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, 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
-