1 19 package org.openharmonise.him.editors; 20 21 import java.io.*; 22 import java.net.*; 23 24 import org.openharmonise.vfs.*; 25 import org.openharmonise.vfs.status.*; 26 27 28 39 public abstract class GenericEditor extends AbstractEditor implements Editor { 40 41 44 public GenericEditor() { 45 super(); 46 } 47 48 51 public PathStatusWrapper open(String sPath, AbstractVirtualFileSystem vfs) { 52 53 VirtualFile vfFile = vfs.getVirtualFile(sPath).getResource(); 54 55 String sWorkingFilePath = super.createWorkingFile(vfFile); 56 57 File fFile = new File(sWorkingFilePath); 58 59 try { 60 Process proc5 = Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler file:/" + fFile.toURI().getPath() ); 61 } catch (MalformedURLException e1) { 62 e1.printStackTrace(); 63 } catch (IOException e1) { 64 e1.printStackTrace(); 65 } 66 67 PathStatusWrapper pathStatus = new PathStatusWrapper(sWorkingFilePath, new VFSStatus()); 68 return pathStatus; 69 } 70 71 74 public PathStatusWrapper createNew(String sPath, AbstractVirtualFileSystem vfs) { 75 PathStatusWrapper pathStatus = new PathStatusWrapper(null, new VFSStatus()); 76 return pathStatus; 77 } 78 79 82 public StatusData export(String sPath, AbstractVirtualFileSystem vfs) { 83 return new VFSStatus(); 84 } 85 86 89 public PathStatusWrapper createNew(String sPath, byte[] content, AbstractVirtualFileSystem vfs) { 90 PathStatusWrapper pathStatus = new PathStatusWrapper(null, new VFSStatus()); 91 return pathStatus; 92 } 93 94 97 public PathStatusWrapper preview(String sPath, AbstractVirtualFileSystem vfs) { 98 VirtualFile vfFile = vfs.getVirtualFile(sPath).getResource(); 99 String sFilename = this.getFileName(vfFile); 100 File fFile = super.createPreviewFile(sFilename, vfFile.getContent()); 101 try { 102 Process proc5 = Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler file:/" + fFile.toURI().getPath() ); 103 } catch (MalformedURLException e1) { 104 e1.printStackTrace(); 105 } catch (IOException e1) { 106 e1.printStackTrace(); 107 } 108 PathStatusWrapper pathStatus = new PathStatusWrapper(fFile.getAbsolutePath(), new VFSStatus()); 109 return pathStatus; 110 } 111 112 115 public PathStatusWrapper upload(String path, AbstractVirtualFileSystem vfs) { 116 PathStatusWrapper pathStatus = new PathStatusWrapper(null, new VFSStatus()); 117 return pathStatus; 118 } 119 } 120
| Popular Tags
|