Package com._1c.g5.v8.dt.import_.xml
Class ImportUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.import_.xml.ImportUtil
-
public class ImportUtil extends Object
Import helper utilities
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXTERNAL_DATA_PROCESSOR_ROOT_ELEMENT
static String
EXTERNAL_REPORT_ROOT_ELEMENT
static String
METADATA_ROOT_ELEMENT
-
Constructor Summary
Constructors Constructor Description ImportUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyWithoutBOM(Path source, Path target, CopyOption... copyOptions)
Copy file without UTF_8 byte order mark.static org.eclipse.emf.ecore.EClass
getExternalObjectType(Path externalObjectPath)
Get external object type by pathstatic String
readTextFromXmlElement(Path xmlFilePath, String... elementPath)
Get text of element by path
-
-
-
Field Detail
-
METADATA_ROOT_ELEMENT
public static final String METADATA_ROOT_ELEMENT
- See Also:
- Constant Field Values
-
EXTERNAL_DATA_PROCESSOR_ROOT_ELEMENT
public static final String EXTERNAL_DATA_PROCESSOR_ROOT_ELEMENT
- See Also:
- Constant Field Values
-
EXTERNAL_REPORT_ROOT_ELEMENT
public static final String EXTERNAL_REPORT_ROOT_ELEMENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
copyWithoutBOM
public static void copyWithoutBOM(Path source, Path target, CopyOption... copyOptions) throws IOException
Copy file without UTF_8 byte order mark.- Parameters:
source
- the path to source file, cannot benull
target
- the path to target file, cannot benull
copyOptions
- options specifying how the copy should be done- Throws:
IOException
- if an I/O error occurs- See Also:
Files.copy(java.io.InputStream, Path, CopyOption...)
-
getExternalObjectType
public static org.eclipse.emf.ecore.EClass getExternalObjectType(Path externalObjectPath) throws IOException, XMLStreamException
Get external object type by path- Parameters:
externalObjectPath
- path to external object "root" file, cannot benull
- Returns:
- type of external object or
null
if type cannot be recognized - Throws:
IOException
- if an I/O error occursXMLStreamException
- if an xml steam processing error occurs
-
readTextFromXmlElement
public static String readTextFromXmlElement(Path xmlFilePath, String... elementPath) throws IOException, XMLStreamException
Get text of element by path- Parameters:
xmlFilePath
- path to xml file, cannot benull
elementPath
- the string names sequence from root xml element to target element with text, cannot benull
- Returns:
- xml element text from given path or
null
if xml element cannot be recognized - Throws:
IOException
- if an I/O error occursXMLStreamException
- if an xml steam processing error occurs
-
-