1 package org.splat.manox;
6 public abstract class Toolbox {
8 // ==============================================================================================================================
10 // ==============================================================================================================================
12 public static Reader getReader (File file) {
13 // ------------------------------------------
14 if (!file.exists()) return null;
16 String[] name = file.getName().split("\\x2E"); // Split around '.' (period) character
17 String fext = name[name.length-1];
20 if (fext.equals("xml")) {
21 XMLDocument odoc = new XMLDocument(file); // Parses the file
22 if (odoc.isWordDocument()) me = new WordXMLDocument(odoc);
24 if (fext.equals("docx")) {
25 //TODO: me = new WordDOCXDocument(file);
30 public static Writer getWriter (File file) {
31 // ------------------------------------------
32 if (!file.exists()) return null;
34 String[] name = file.getName().split("\\x2E"); // Split around '.' (period) character
35 String fext = name[name.length-1];
38 if (fext.equals("xml")) {
39 XMLDocument odoc = new XMLDocument(file); // Parses the file
40 if (odoc.isWordDocument()) me = new WordXMLDocument(odoc);