public class FileUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
toFile(JSONElement element,
java.io.File file)
Save a JSONElement as a File.
|
static void |
toFile(JSONElement element,
java.io.File file,
JSONOptions options)
Save a JSONElement as a File.
|
static void |
toFile(JSONElement element,
java.io.File file,
java.lang.String var)
Save a JSONArray as a File, using a specified indentFactor and indent.
|
static void |
toFile(JSONElement element,
java.io.File file,
java.lang.String var,
JSONOptions options)
Save a JSONElement as a File.
|
static JSONArray |
toJSONArray(java.io.BufferedReader reader)
Use a reader to load a JSONArray.
|
static JSONArray |
toJSONArray(java.io.File file)
Load a File as a JSONArray.
|
static JSONArray |
toJSONArray(java.io.File file,
JSONOptions options)
Load a File as a JSONArray.
|
static JSONArray |
toJSONArray(java.io.InputStream stream)
Load an InputStream as a JSONArray.
|
static JSONArray |
toJSONArray(java.io.InputStream stream,
JSONOptions options)
Load an InputStream as a JSONArray.
|
static JSONArray |
toJSONArray(java.net.URL url)
Load an URL as a JSONArray.
|
static JSONArray |
toJSONArray(java.net.URL url,
JSONOptions options)
Load an URL as a JSONArray.
|
static JSONElement |
toJSONElement(java.io.File file)
Load a File as a JSONElement.
|
static JSONElement |
toJSONElement(java.io.File file,
JSONOptions options)
Load a File as a JSONElement.
|
static JSONElement |
toJSONElement(java.io.InputStream stream)
Load an InputStream as a JSONElement.
|
static JSONElement |
toJSONElement(java.io.InputStream stream,
JSONOptions options)
Load an InputStream as a JSONElement.
|
static JSONElement |
toJSONElement(java.net.URL url)
Load an URL as a JSONElement.
|
static JSONElement |
toJSONElement(java.net.URL url,
JSONOptions options)
Load an URL as a JSONElement.
|
static JSONObject |
toJSONObject(java.io.BufferedReader reader)
Use a reader to load a JSONObject.
|
static JSONObject |
toJSONObject(java.io.File file)
Load a File as a JSONObject.
|
static JSONObject |
toJSONObject(java.io.File file,
JSONOptions options)
Load a File as a JSONObject.
|
static JSONObject |
toJSONObject(java.io.InputStream stream)
Load an InputStream as a JSONObject.
|
static JSONObject |
toJSONObject(java.io.InputStream stream,
JSONOptions options)
Load an InputStream as a JSONObject.
|
static JSONObject |
toJSONObject(java.net.URL url)
Load an URL as a JSONObject.
|
static JSONObject |
toJSONObject(java.net.URL url,
JSONOptions options)
Load an URL as a JSONObject.
|
static JSONObject |
toJSONObjectFromXML(java.io.File file)
Convert an XML File to a JSONObject.
|
static JSONObject |
toJSONObjectFromXML(java.io.File file,
JSONOptions options)
Convert an XML File to a JSONObject.
|
static JSONObject |
toJSONObjectFromXML(java.net.URL url)
Convert an XML URL to a JSONObject.
|
static JSONObject |
toJSONObjectFromXML(java.net.URL url,
JSONOptions options)
Convert an XML URL to a JSONObject.
|
static void |
toURL(JSONElement element,
java.net.URL url)
Save a JSONElement as an URL, using a specified indentFactor and indent.
|
static void |
toURL(JSONElement element,
java.net.URL url,
JSONOptions options)
Save a JSONElement as an URL, using a specified indentFactor and indent.
|
static void |
toURL(JSONElement element,
java.net.URL url,
java.lang.String var,
JSONOptions options)
Save a JSONElement as an URL, using a specified indentFactor and indent.
|
public static void toFile(JSONElement element, java.io.File file, java.lang.String var) throws java.io.IOException, JSONException
element - the JSONElementfile - the filevar - the variable to affectjava.io.IOException - if an IOException occuredJSONException - if the JSONArray was unable to writepublic static void toFile(JSONElement element, java.io.File file, java.lang.String var, JSONOptions options) throws java.io.IOException, JSONException
element - the JSONElementfile - the filevar - the variable to affectoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the JSONArray was unable to writepublic static void toFile(JSONElement element, java.io.File file, JSONOptions options) throws java.io.IOException, JSONException
element - the JSONElementfile - the fileoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the JSONArray was unable to writepublic static void toFile(JSONElement element, java.io.File file) throws java.io.IOException, JSONException
element - the JSONElementfile - the filejava.io.IOException - if an IOException occuredJSONException - if the JSONArray was unable to writepublic static void toURL(JSONElement element, java.net.URL url) throws java.io.IOException, JSONException
element - the JSONElementurl - the URLjava.io.IOException - if an IOException occuredJSONException - if the JSONArray was unable to writepublic static void toURL(JSONElement element, java.net.URL url, JSONOptions options) throws java.io.IOException, JSONException
element - the JSONElementurl - the URLoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the JSONArray was unable to writepublic static void toURL(JSONElement element, java.net.URL url, java.lang.String var, JSONOptions options) throws java.io.IOException, JSONException
element - the JSONElementurl - the URLvar - the variable to affectoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the JSONArray was unable to writepublic static JSONElement toJSONElement(java.io.File file) throws java.io.IOException, JSONException
file - the Filejava.io.IOException - if an IOException occuredJSONException - if the File is not a valid JSON filepublic static JSONElement toJSONElement(java.io.File file, JSONOptions options) throws java.io.IOException, JSONException
file - the Fileoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the File is not a valid JSON filepublic static JSONArray toJSONArray(java.io.File file) throws java.io.IOException, JSONException
file - the Filejava.io.IOException - if an IOException occuredJSONException - if the File is not a valid JSON filepublic static JSONArray toJSONArray(java.io.File file, JSONOptions options) throws java.io.IOException, JSONException
file - the Fileoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the File is not a valid JSON filepublic static JSONElement toJSONElement(java.net.URL url) throws java.io.IOException, JSONException
url - the URLjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONElement toJSONElement(java.net.URL url, JSONOptions options) throws java.io.IOException, JSONException
url - the URLoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONElement toJSONElement(java.io.InputStream stream) throws java.io.IOException, JSONException
stream - the InputStreamjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONElement toJSONElement(java.io.InputStream stream, JSONOptions options) throws java.io.IOException, JSONException
stream - the InputStreamoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONArray toJSONArray(java.net.URL url) throws java.io.IOException, JSONException
url - the URLjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONArray toJSONArray(java.io.InputStream stream) throws java.io.IOException, JSONException
stream - the InputStreamjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONArray toJSONArray(java.net.URL url, JSONOptions options) throws java.io.IOException, JSONException
url - the URLoptions - the JSON configuration optionssjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONArray toJSONArray(java.io.InputStream stream, JSONOptions options) throws java.io.IOException, JSONException
stream - the InputStreamoptions - the JSON configuration optionssjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONArray toJSONArray(java.io.BufferedReader reader) throws java.io.IOException, JSONException
reader - the readerjava.io.IOException - if an IOException occuredJSONException - if a JSONException occuredpublic static JSONObject toJSONObject(java.net.URL url) throws java.io.IOException, JSONException
url - the URLjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONObject toJSONObject(java.net.URL url, JSONOptions options) throws java.io.IOException, JSONException
url - the URLoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONObject toJSONObject(java.io.InputStream stream) throws java.io.IOException, JSONException
stream - the InputStreamjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONObject toJSONObject(java.io.InputStream stream, JSONOptions options) throws java.io.IOException, JSONException
stream - the InputStreamoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the URL is not a valid JSON filepublic static JSONObject toJSONObject(java.io.File file) throws java.io.IOException, JSONException
file - the Filejava.io.IOException - if an IOException occuredJSONException - if the File is not a valid JSON filepublic static JSONObject toJSONObject(java.io.File file, JSONOptions options) throws java.io.IOException, JSONException
file - the Fileoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the File is not a valid JSON filepublic static JSONObject toJSONObject(java.io.BufferedReader reader) throws java.io.IOException, JSONException
reader - the readerjava.io.IOException - if an IOException occuredJSONException - if a JSONException occuredpublic static JSONObject toJSONObjectFromXML(java.net.URL url) throws java.io.IOException, JSONException
url - the XML URLjava.io.IOException - if an IOException occuredJSONException - if the XML URL is not a valid JSON filepublic static JSONObject toJSONObjectFromXML(java.net.URL url, JSONOptions options) throws java.io.IOException, JSONException
url - the XML URLoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the XML URL is not a valid JSON filepublic static JSONObject toJSONObjectFromXML(java.io.File file) throws java.io.IOException, JSONException
file - the XML Filejava.io.IOException - if an IOException occuredJSONException - if the XML File is not a valid JSON filepublic static JSONObject toJSONObjectFromXML(java.io.File file, JSONOptions options) throws java.io.IOException, JSONException
file - the XML Fileoptions - the JSON configuration optionsjava.io.IOException - if an IOException occuredJSONException - if the XML File is not a valid JSON fileCopyright (C) 2017 Wei Song. Copyright (c) 2002 JSON.org. Copyright © 2018, 2019, 2026 Herve Girod. All Rights Reserved. elasticlunr Documentation and source under the MIT licence. JSON Documentation and source under the JSON licence