--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.eclipse.ui.rap</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Wed Mar 02 13:27:08 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
<Import-Package>
org.springframework.beans.factory,
org.springframework.core.io.support,
+ org.apache.commons.io,
+ org.argeo,
+ org.argeo.eclipse.ui.dialogs,
!org.eclipse.core.runtime,
!org.eclipse.core.commands,
!org.eclipse.ui.plugin,
<artifactId>org.argeo.eclipse.ui</artifactId>
<version>0.2.3-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>com.springsource.org.apache.commons.io</artifactId>
+ </dependency>
+
</dependencies>
</project>
package org.argeo.eclipse.ui.specific;
-import java.awt.Desktop;
-import java.io.BufferedInputStream;
import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
-import org.apache.commons.io.IOUtils;
-import org.argeo.ArgeoException;
-
-//import org.apache.commons.io;
+//import org.argeo.eclipse.ui.dialogs.Error;
public class FileHandler {
- private BufferedInputStream bis;
-
public FileHandler() {
}
- public File createTmpFile(String fileName, String suffix, InputStream is) {
+ public void openFile(String fileName, InputStream is) {
+ // org.argeo.eclipse.ui.dialogs.Error.show("In Open File for RAP.");
+ }
+
+ private File createTmpFile(String prefix, String suffix, InputStream is) {
File tmpFile = null;
- OutputStream os = null;
- try {
- tmpFile = File.createTempFile(fileName, suffix);
- os = new FileOutputStream(tmpFile);
- IOUtils.copy(is, os);
- } catch (IOException e) {
- throw new ArgeoException("Cannot open file " + fileName, e);
- } finally {
- IOUtils.closeQuietly(os);
- }
return tmpFile;
}
- public void openFile(String fileName, InputStream is) {
-
- String prefix ="", extension = "";
-
- if (fileName != null){
- int ind = fileName.
- if (true){
- }
- }
-
- prefix = .substring(0,
- node.getName().lastIndexOf('.'));
- extension = node.getName().substring(
- node.getName().lastIndexOf('.'));
- try {
- Desktop desktop = null;
- if (Desktop.isDesktopSupported()) {
- desktop = Desktop.getDesktop();
- }
- desktop.open(file);
- } catch (IOException e) {
- throw new ArgeoException("Cannot open file " + file.getName(), e);
- }
- }
-
-
- public void openFile(File file) {
- try {
- Desktop desktop = null;
- if (Desktop.isDesktopSupported()) {
- desktop = Desktop.getDesktop();
- }
- desktop.open(file);
- } catch (IOException e) {
- throw new ArgeoException("Cannot open file " + file.getName(), e);
- }
- }
}