Class DataUri
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Note: This file has been modified for usage in the JSVG project.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable Charsetprivate static final Stringprivate static final Stringprivate final @Nullable Stringprivate final byte @NotNull []private final @Nullable Stringprivate static final Stringprivate final @NotNull Stringprivate static final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Charsetcharset()@Nullable Stringbyte @NotNull []data()boolean@Nullable Stringfilename()inthashCode()@NotNull Stringmime()static DataUriTries to parse a data URI described in RFC2397private static StringpercentDecode(String s, Charset cs) toString()
-
Field Details
-
CHARSET_OPTION_NAME
- See Also:
-
FILENAME_OPTION_NAME
- See Also:
-
CONTENT_DISPOSITION_OPTION_NAME
- See Also:
-
mime
-
charset
-
filename
-
contentDisposition
-
data
private final byte @NotNull [] data -
PLUS
-
-
Constructor Details
-
DataUri
-
DataUri
-
-
Method Details
-
mime
-
data
public byte @NotNull [] data() -
charset
-
contentDisposition
-
filename
-
equals
-
hashCode
-
parse
public static DataUri parse(@NotNull @NotNull String uri, Charset charset) throws DataUri.MalformedDataUriException Tries to parse a data URI described in RFC2397- Parameters:
uri- A string representing the data URIcharset- Charset to use when decoding percent encoded options like filename- Returns:
- Parsed data URI
- Throws:
IllegalArgumentException- iff an error occurred during parse processDataUri.MalformedDataUriException
-
toString
-
percentDecode
-