diff --git a/src/main/java/org/libreoffice/example/comp/RegistrationHandler.classes b/src/main/java/org/libreoffice/example/comp/RegistrationHandler.classes
deleted file mode 100644
index e69de29..0000000
diff --git a/src/main/java/org/libreoffice/example/comp/RegistrationHandler.java b/src/main/java/org/libreoffice/example/comp/RegistrationHandler.java
deleted file mode 100644
index 3819b73..0000000
--- a/src/main/java/org/libreoffice/example/comp/RegistrationHandler.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*************************************************************************
- *
- * The Contents of this file are made available subject to the terms of
- * either of the GNU Lesser General Public License Version 2.1
- *
- * Sun Microsystems Inc., October, 2000
- *
- *
- * GNU Lesser General Public License Version 2.1
- * =============================================
- * Copyright 2000 by Sun Microsystems, Inc.
- * 901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
- *
- * Copyright: 2002 by Sun Microsystems, Inc.
- *
- * All Rights Reserved.
- *
- * Contributor(s): Cedric Bosdonnat
- *
- *
- ************************************************************************/
-package org.libreoffice.example.comp;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
-import com.sun.star.lang.XSingleComponentFactory;
-import com.sun.star.registry.XRegistryKey;
-
-/**
- * Component main registration class.
- *
- *
This class should not be modified.
- *
- * @author Cedric Bosdonnat aka. cedricbosdo
- *
- */
-public class RegistrationHandler {
-
- /**
- * Get a component factory for the implementations handled by this class.
- *
- * This method calls all the methods of the same name from the classes listed
- * in the RegistrationHandler.classes
file. This method
- * should not be modified.
- *
- * @param pImplementationName the name of the implementation to create.
- *
- * @return the factory which can create the implementation.
- */
- public static XSingleComponentFactory __getComponentFactory(String sImplementationName ) {
- XSingleComponentFactory xFactory = null;
-
- Class[] classes = findServicesImplementationClasses();
-
- int i = 0;
- while (i < classes.length && xFactory == null) {
- Class clazz = classes[i];
- if ( sImplementationName.equals( clazz.getCanonicalName() ) ) {
- try {
- Class[] getTypes = new Class[]{String.class};
- Method getFactoryMethod = clazz.getMethod("__getComponentFactory", getTypes);
- Object o = getFactoryMethod.invoke(null, sImplementationName);
- xFactory = (XSingleComponentFactory)o;
- } catch (Exception e) {
- // Nothing to do: skip
- System.err.println("Error happened");
- e.printStackTrace();
- }
- }
- i++;
- }
- return xFactory;
- }
-
- /**
- * Writes the services implementation informations to the UNO registry.
- *
- * This method calls all the methods of the same name from the classes listed
- * in the RegistrationHandler.classes
file. This method
- * should not be modified.
- *
- * @param pRegistryKey the root registry key where to write the informations.
- *
- * @return true
if the informations have been successfully written
- * to the registry key, false
otherwise.
- */
- public static boolean __writeRegistryServiceInfo(XRegistryKey xRegistryKey ) {
-
- Class[] classes = findServicesImplementationClasses();
-
- boolean success = true;
- int i = 0;
- while (i < classes.length && success) {
- Class clazz = classes[i];
- try {
- Class[] writeTypes = new Class[]{XRegistryKey.class};
- Method getFactoryMethod = clazz.getMethod("__writeRegistryServiceInfo", writeTypes);
- Object o = getFactoryMethod.invoke(null, xRegistryKey);
- success = success && ((Boolean)o).booleanValue();
- } catch (Exception e) {
- success = false;
- e.printStackTrace();
- }
- i++;
- }
- return success;
- }
-
- /**
- * @return all the UNO implementation classes.
- */
- private static Class[] findServicesImplementationClasses() {
-
- ArrayList classes = new ArrayList();
-
- InputStream in = RegistrationHandler.class.getResourceAsStream("RegistrationHandler.classes");
- LineNumberReader reader = new LineNumberReader(new InputStreamReader(in));
-
- try {
- String line = reader.readLine();
- while (line != null) {
- if (!line.equals("")) {
- line = line.trim();
- try {
- Class clazz = Class.forName(line);
-
- Class[] writeTypes = new Class[]{XRegistryKey.class};
- Class[] getTypes = new Class[]{String.class};
-
- Method writeRegMethod = clazz.getMethod("__writeRegistryServiceInfo", writeTypes);
- Method getFactoryMethod = clazz.getMethod("__getComponentFactory", getTypes);
-
- if (writeRegMethod != null && getFactoryMethod != null) {
- classes.add(clazz);
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- line = reader.readLine();
- }
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- reader.close();
- in.close();
- } catch (Exception e) {};
- }
-
- return classes.toArray(new Class[classes.size()]);
- }
-}
diff --git a/src/main/java/w2phtml/BatchHandlerImpl.java b/src/main/java/w2phtml/BatchHandlerImpl.java
deleted file mode 100644
index 46cca3c..0000000
--- a/src/main/java/w2phtml/BatchHandlerImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/************************************************************************
- *
- * BatchHandlerImpl.java
- *
- * Copyright: 2002-2008 by Henrik Just
- *
- * This file is part of Writer2LaTeX.
- *
- * Writer2LaTeX is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Writer2LaTeX is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Writer2LaTeX. If not, see .
- *
- * Version 1.0 (2008-10-03)
- *
- */
-
-package w2phtml;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import w2phtml.api.BatchHandler;
-
-/** This class implements a BatchHandler
for command line usage
- */
-public class BatchHandlerImpl implements BatchHandler {
- private int nIndent = 0;
-
- private void writeMessage(String sMsg) {
- for (int i=0; i Conversion of the directory "+sName+" failed!");
- }
- }
-
- public void startFile(String sName) {
- writeMessage("Converting file "+sName);
- nIndent++;
- }
-
- public void endFile(String sName, boolean bSuccess) {
- nIndent--;
- if (!bSuccess) {
- writeMessage("--> Conversion of the file "+sName+" failed!");
- }
- }
-
- public boolean cancel() {
- try {
- if (System.in.available()>0) {
- BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
- in.readLine();
- System.out.print("Do you want to cancel the conversion (y/n)? ");
- String s = in.readLine();
- if (s!= null && s.toLowerCase().startsWith("y")) { return true; }
- }
- }
- catch (IOException e) {
- }
- return false;
- }
-
-}
diff --git a/src/main/java/w2phtml/api/BatchHandler.java b/src/main/java/w2phtml/api/BatchHandler.java
deleted file mode 100644
index 6ace11f..0000000
--- a/src/main/java/w2phtml/api/BatchHandler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/************************************************************************
- *
- * BatchHandler.java
- *
- * Copyright: 2002-2008 by Henrik Just
- *
- * This file is part of Writer2LaTeX.
- *
- * Writer2LaTeX is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Writer2LaTeX is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Writer2LaTeX. If not, see .
- *
- * Version 1.0 (2008-11-23)
- *
- */
-
-package w2phtml.api;
-
-/** This is a call back interface to handle user interaction during a
- * batch conversion with a {@link BatchConverter}
- */
-public interface BatchHandler {
-
- /** Notification that the conversion is started */
- public void startConversion();
-
- /** Notification that the conversion has finished */
- public void endConversion();
-
- /** Notification that a directory conversion starts
- *
- * @param sName the name of the directory to convert
- */
- public void startDirectory(String sName);
-
- /** Notification that a directory conversion has finished
- *
- * @param sName the name of the directory
- * @param bSuccess true if the conversion was successful (this only means
- * that the index page was created with success, not that the conversion
- * of files and subdirectories was successful)
- */
- public void endDirectory(String sName, boolean bSuccess);
-
- /** Notification that a file conversion starts
- *
- * @param sName the name of the file to convert
- */
- public void startFile(String sName);
-
- /** Notification that a file conversion has finished
- *
- * @param sName the name of the file
- * @param bSuccess true if the conversion of this file was successful
- */
- public void endFile(String sName, boolean bSuccess);
-
- /** Notification that the conversion may be cancelled. The
- * {@link BatchConverter} fires this event once per document.
- * Cancelling the conversion does not delete files that was already
- * converted
- *
- * @return true if the handler wants to cancel the conversion
- */
- public boolean cancel();
-
-}