|
|
@ -79,6 +79,7 @@ public class plasmaParserDocument {
|
|
|
|
Map emaillinks;
|
|
|
|
Map emaillinks;
|
|
|
|
plasmaCondenser condenser;
|
|
|
|
plasmaCondenser condenser;
|
|
|
|
boolean resorted;
|
|
|
|
boolean resorted;
|
|
|
|
|
|
|
|
private InputStream textStream;
|
|
|
|
|
|
|
|
|
|
|
|
public plasmaParserDocument(URL location, String mimeType, String charset,
|
|
|
|
public plasmaParserDocument(URL location, String mimeType, String charset,
|
|
|
|
String[] keywords, String shortTitle, String longTitle,
|
|
|
|
String[] keywords, String shortTitle, String longTitle,
|
|
|
@ -156,9 +157,12 @@ public class plasmaParserDocument {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (this.text == null) return null;
|
|
|
|
if (this.text == null) return null;
|
|
|
|
|
|
|
|
|
|
|
|
if (this.text instanceof File) return new BufferedInputStream(new FileInputStream((File)this.text));
|
|
|
|
if (this.text instanceof File) {
|
|
|
|
else if (this.text instanceof byte[]) return new ByteArrayInputStream((byte[])this.text);
|
|
|
|
this.textStream = new BufferedInputStream(new FileInputStream((File)this.text));
|
|
|
|
|
|
|
|
} else if (this.text instanceof byte[]) {
|
|
|
|
|
|
|
|
this.textStream = new ByteArrayInputStream((byte[])this.text);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.textStream;
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -320,9 +324,26 @@ public class plasmaParserDocument {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void close() {
|
|
|
|
public void close() {
|
|
|
|
|
|
|
|
// try close the output stream
|
|
|
|
|
|
|
|
if (this.textStream != null) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
this.textStream.close();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
/* ignore this */
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
this.textStream = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// delete the temp file
|
|
|
|
// delete the temp file
|
|
|
|
if ((this.text != null) && (this.text instanceof File)) {
|
|
|
|
if ((this.text != null) && (this.text instanceof File)) {
|
|
|
|
try { ((File)this.text).delete(); } catch (Exception e) {/* ignore this */}
|
|
|
|
try {
|
|
|
|
|
|
|
|
((File)this.text).delete();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
/* ignore this */
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
this.text = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|