Remove dead Java code

This commit is contained in:
Luke Petrolekas
2011-02-12 18:48:48 +01:00
committed by Thomas Arnhold
parent 27386be30d
commit c0b7906947
2 changed files with 6 additions and 73 deletions

View File

@@ -93,8 +93,6 @@ public class XMergeBridge {
private static String sFileName=null;
private static String sURL="";
//private static FileOutputStream adaptedStream =null;
/** This inner class provides the component as a concrete implementation
* of the service description. It implements the needed interfaces.
*/
@@ -160,16 +158,7 @@ public class XMergeBridge {
public boolean importer(com.sun.star.beans.PropertyValue[] aSourceData,
com.sun.star.xml.sax.XDocumentHandler xDocHandler,
java.lang.String[] msUserData) throws com.sun.star.uno.RuntimeException {
/*
System.out.println("\nFound the Importer!\n");
System.out.println("\n"+msUserData[0]);
System.out.println("\n"+msUserData[1]);
System.out.println("\n"+msUserData[2]);
System.out.println("\n"+msUserData[3]);
System.out.println("\n"+msUserData[4]);
System.out.println("\n"+msUserData[5]);
*/
sFileName="";
sURL="";
String sDirectory = null;
@@ -185,10 +174,7 @@ public class XMergeBridge {
for (int i = 0 ; i < pValue.length; i++)
{
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value;
try{
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
if (pValue[i].Name.compareTo("InputStream")==0){
xis=(com.sun.star.io.XInputStream)AnyConverter.toObject(new Type(com.sun.star.io.XInputStream.class), pValue[i].Value);
}
@@ -243,11 +229,9 @@ public class XMergeBridge {
}
catch (IOException e){
//System.out.println("XMergeBridge IO Exception "+e.getMessage());
return false;
}
catch (Exception e){
//System.out.println("XMergeBridge Exception "+e+" "+e.getMessage());
return false;
}
return true;
@@ -256,16 +240,6 @@ public class XMergeBridge {
public boolean exporter(com.sun.star.beans.PropertyValue[] aSourceData,
java.lang.String[] msUserData) throws com.sun.star.uno.RuntimeException{
/*
System.out.println("\nFound the Exporter!\n");
System.out.println("\n"+msUserData[0]);
System.out.println("\n"+msUserData[1]);
System.out.println("\n"+msUserData[2]);
System.out.println("\n"+msUserData[3]);
System.out.println("\n"+msUserData[4]);
System.out.println("\n"+msUserData[5]);
*/
sFileName=null;
sURL=null;
String sDirectory = null;
@@ -281,28 +255,22 @@ public class XMergeBridge {
for (int i = 0 ; i < pValue.length; i++)
{
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
try{
//System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
if (pValue[i].Name.compareTo("OutputStream")==0){
xos=(com.sun.star.io.XOutputStream)AnyConverter.toObject(new Type(com.sun.star.io.XOutputStream.class), pValue[i].Value);
// System.out.println(pValue[i].Name+" "+xos);
}
if (pValue[i].Name.compareTo("FileName")==0){
sFileName=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
//System.out.println(pValue[i].Name+" "+sFileName);
}
if (pValue[i].Name.compareTo("URL")==0){
sURL=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
// System.out.println("\nMediaDescriptor url "+pValue[i].Name+" "+sURL);
}
if (pValue[i].Name.compareTo("Title")==0){
if (pValue[i].Name.compareTo("Title")==0){
title=(String)AnyConverter.toObject(new Type(java.lang.String.class), pValue[i].Value);
//System.out.println(pValue[i].Name+" "+title);
}
}
catch(com.sun.star.lang.IllegalArgumentException AnyExec){
@@ -379,7 +347,6 @@ public class XMergeBridge {
public void startDocument () {
//System.out.println("\nStart Document!");
}
public void endDocument()throws com.sun.star.uno.RuntimeException
@@ -391,12 +358,10 @@ public class XMergeBridge {
}
catch (IOException e){
//System.out.println("Exception "+e);
throw new com.sun.star.uno.RuntimeException(e.getMessage());
}
catch (Exception e){
//System.out.println("Exception "+e);
throw new com.sun.star.uno.RuntimeException("Xmerge Exception");
}
@@ -421,7 +386,7 @@ public class XMergeBridge {
}
}
str=str.concat(">");
// System.out.println(str);
try{
xOutStream.writeBytes(str.getBytes("UTF-8"));
}
@@ -534,12 +499,10 @@ public class XMergeBridge {
int i=1;
while (docEnum.hasMoreElements() && sURL.startsWith("file:")) {
//URI uri=new URI(sFileName);
URI uri=new URI(sURL);
String newFileName= getPath(uri);
//System.out.println("\nURI: "+uri.getPath());
File newFile=null;
if (newFileName.lastIndexOf(".")!=-1){
newFile =new File(newFileName.substring(0,newFileName.lastIndexOf("."))+String.valueOf(i)+newFileName.substring(newFileName.lastIndexOf(".")));
@@ -583,27 +546,15 @@ public class XMergeBridge {
}
else
{
/*
ByteArrayOutputStream bout = new ByteArrayOutputStream();
byte[][] buf = new byte[1][4096];
int n=0;
while ((n=xml.readSomeBytes(buf, 4096))>0)
bout.write(buf[0], 0, n);
ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
cv.addInputStream(name, bin, false);
*/
cv.addInputStream(name,(InputStream)xis,false);
//System.out.println("\nConverting");
ConvertData dataIn = cv.convert();
//System.out.println("\nFinished Converting");
Enumeration docEnum = dataIn.getDocumentEnumeration();
while (docEnum.hasMoreElements()) {
OfficeDocument docIn = (OfficeDocument)docEnum.nextElement();
docIn.write(newxos,false);
}
//newxos.write(-1); //EOF character
//newxos.flush();
newxos.close();
}
ConverterInfoMgr.removeByJar(jarName);
@@ -631,12 +582,6 @@ public class XMergeBridge {
return path;
}
// Implement methods from interface XTypeProvider
public byte[] getImplementationId() {
byte[] byteReturn = {};