Package esmska.persistence
Class ImportManager
- java.lang.Object
-
- esmska.persistence.ImportManager
-
public class ImportManager extends java.lang.ObjectImport program data
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.ArrayList<Contact>importContacts(java.io.File file, ContactParser.ContactType type)Import contacts from filestatic java.util.HashSet<DeprecatedGateway>importDeprecatedGateways(java.io.File file)Get set of deprecated gateways from a filestatic java.util.HashSet<DeprecatedGateway>importDeprecatedGateways(java.lang.String resource)Get set of deprecated gateways from jar resourcestatic java.util.HashSet<DeprecatedGateway>importDeprecatedGateways(java.net.URL url)Get set of deprecated gateways from URLstatic voidimportGatewayProperties(java.io.File file)Import all gateway properties from file.static java.util.TreeSet<Gateway>importGateways(java.io.File directory, boolean deleteOnFail)Import all gateways from directorystatic java.util.TreeSet<Gateway>importGateways(java.lang.String resource)Import all gateways from jar resourcestatic voidimportGlobalConfig(java.io.File file)Import configuration from system-wide config into Config defaultsstatic java.util.ArrayList<History.Record>importHistory(java.io.File file)Import sms history from filestatic voidimportKeyring(java.io.File file)Import keyring data from file.static java.util.ArrayList<SMS>importQueue(java.io.File file)Import sms queue from file
-
-
-
Method Detail
-
importContacts
public static java.util.ArrayList<Contact> importContacts(java.io.File file, ContactParser.ContactType type) throws java.lang.Exception
Import contacts from file- Throws:
java.lang.Exception
-
importQueue
public static java.util.ArrayList<SMS> importQueue(java.io.File file) throws java.lang.Exception
Import sms queue from file- Throws:
java.lang.Exception
-
importHistory
public static java.util.ArrayList<History.Record> importHistory(java.io.File file) throws java.lang.Exception
Import sms history from file- Throws:
java.lang.Exception
-
importGateways
public static java.util.TreeSet<Gateway> importGateways(java.lang.String resource) throws java.io.IOException, java.beans.IntrospectionException
Import all gateways from jar resource- Parameters:
resource- jar absolute resource path where to look for gateways- Throws:
java.io.IOException- When there is problem accessing gateway directory or filesjava.beans.IntrospectionException- When current JRE does not support JavaScript execution
-
importGateways
public static java.util.TreeSet<Gateway> importGateways(java.io.File directory, boolean deleteOnFail) throws java.io.IOException, java.beans.IntrospectionException
Import all gateways from directory- Parameters:
directory- directory where to look for gatewaysdeleteOnFail- whether to delete gateway files that fail to be loaded- Throws:
java.io.IOException- When there is problem accessing gateway directory or filesjava.beans.IntrospectionException- When current JRE does not support JavaScript execution
-
importDeprecatedGateways
public static java.util.HashSet<DeprecatedGateway> importDeprecatedGateways(java.lang.String resource) throws java.io.IOException, org.xml.sax.SAXException
Get set of deprecated gateways from jar resource- Parameters:
resource- jar absolute resource path with xml file- Throws:
java.io.IOExceptionorg.xml.sax.SAXException- See Also:
importDeprecatedGateways(java.net.URL)
-
importDeprecatedGateways
public static java.util.HashSet<DeprecatedGateway> importDeprecatedGateways(java.io.File file) throws java.io.IOException, org.xml.sax.SAXException
Get set of deprecated gateways from a file- Parameters:
file- xml containing description of deprecated gateways- Throws:
java.io.IOExceptionorg.xml.sax.SAXException- See Also:
importDeprecatedGateways(java.net.URL)
-
importDeprecatedGateways
public static java.util.HashSet<DeprecatedGateway> importDeprecatedGateways(java.net.URL url) throws java.io.IOException, org.xml.sax.SAXException
Get set of deprecated gateways from URL- Parameters:
url- url to xml file (file or jar url) containing description of deprecated gateways- Returns:
- set of deprecated gateways
- Throws:
java.io.IOException- problem accessing jar resourceorg.xml.sax.SAXException- problem parsing the file
-
importKeyring
public static void importKeyring(java.io.File file) throws java.lang.ExceptionImport keyring data from file.- Parameters:
file- File to import from.- Throws:
java.lang.Exception- When some error occur during file processing.
-
importGlobalConfig
public static void importGlobalConfig(java.io.File file) throws java.io.IOExceptionImport configuration from system-wide config into Config defaults- Throws:
java.io.IOException
-
importGatewayProperties
public static void importGatewayProperties(java.io.File file) throws java.io.IOExceptionImport all gateway properties from file.- Throws:
java.io.IOException
-
-