Package com.itextpdf.io.util
Class UrlUtil
java.lang.Object
com.itextpdf.io.util.UrlUtil
This file is a helper class for internal usage only.
Be aware that its API and functionality may be changed in future.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFileUriString
(String filename) This method gets uri string from a file.(package private) static URLConnection
getFinalConnection
(URL initialUrl) Gets the connection related to the last redirected url.static InputStream
getInputStreamOfFinalConnection
(URL initialUrl) Gets the input stream of connection related to last redirected url.static String
getNormalizedFileUriString
(String filename) This method gets normalized uri string from a file.static InputStream
openStream
(URL url) static String
toAbsoluteURI
(URI uri) Get the entire URI string which is properly encoded.static URI
toNormalizedURI
(File file) This method makes a normalized URI from a given file.static URI
toNormalizedURI
(String filename) This method makes a normalized URI from a given filename.static URL
This method makes a valid URL from a given filename.
-
Constructor Details
-
UrlUtil
private UrlUtil()
-
-
Method Details
-
toURL
This method makes a valid URL from a given filename.This method makes the conversion of this library from the JAVA 2 platform to a JDK1.1.x-version easier.
- Parameters:
filename
- a given filename- Returns:
- a valid URL
- Throws:
MalformedURLException
-
toNormalizedURI
This method makes a normalized URI from a given filename.- Parameters:
filename
- a given filename- Returns:
- a valid URI
-
toNormalizedURI
This method makes a normalized URI from a given file.- Parameters:
file
- a given filename- Returns:
- a valid URI
-
toAbsoluteURI
Get the entire URI string which is properly encoded.- Parameters:
uri
- URI which convert to string- Returns:
- URI string representation
-
openStream
- Throws:
IOException
-
getFileUriString
This method gets uri string from a file.- Parameters:
filename
- a given filename- Returns:
- a uri string
- Throws:
MalformedURLException
-
getNormalizedFileUriString
This method gets normalized uri string from a file.- Parameters:
filename
- a given filename- Returns:
- a normalized uri string
-
getInputStreamOfFinalConnection
Gets the input stream of connection related to last redirected url. You should manually close input stream after calling this method to not hold any open resources.- Parameters:
initialUrl
- an initial URL.- Returns:
- an input stream of connection related to the last redirected url.
- Throws:
IOException
- signals that an I/O exception has occurred.
-
getFinalConnection
Gets the connection related to the last redirected url. You should close connection manually after calling this method, to not hold any open resources.- Parameters:
initialUrl
- an initial URL.- Returns:
- connection related to the last redirected url.
- Throws:
IOException
- signals that an I/O exception has occurred.
-