1 19 package org.openharmonise.him; 20 21 import java.io.*; 22 23 import org.openharmonise.him.editors.*; 24 import org.openharmonise.him.window.*; 25 import org.openharmonise.him.window.messages.*; 26 import org.openharmonise.vfs.metadata.*; 27 28 29 36 public class HarmoniseInformationManager { 37 38 41 private VFSMessageRouter m_vfsRouter = null; 42 43 public HarmoniseInformationManager() { 44 super(); 45 this.setup(); 46 } 47 48 53 private void setup() { 54 55 this.checkFileSystem(); 56 57 System.setProperty("javax.net.ssl.trustStore", "C:\\ContentManager\\auths\\ContentManager"); 58 System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); 59 60 DisplayManager.getInstance().showMainWindow(); 61 DisplayController displayController = new DisplayController(DisplayManager.getInstance()); 62 63 ValueCache.getInstance().load("C:\\ContentManager\\vals.xml"); 64 PropertyCache.getInstance().load("C:\\ContentManager\\props.xml"); 65 66 67 MessageHandler.getInstance().fireMessageEvent("Logged into the Harmonise Server", MessageHandler.TYPE_INFORMATION); 68 69 m_vfsRouter = new VFSMessageRouter(); 70 } 71 72 77 public static void main(String [] args) { 78 HarmoniseInformationManager manager = new HarmoniseInformationManager(); 79 80 } 81 82 87 private void checkFileSystem() { 88 File file = new File("C:\\ContentManager"); 89 if(!file.exists()) { 90 file.mkdir(); 91 } 92 file = new File("C:\\ContentManager\\auths"); 93 if(!file.exists()) { 94 file.mkdir(); 95 } 96 file = new File("C:\\ContentManager\\auths\\las"); 97 if(!file.exists()) { 98 file.mkdir(); 99 } 100 file = new File("C:\\ContentManager\\temp"); 101 if(!file.exists()) { 102 file.mkdir(); 103 } 104 EditorController.getInstance().clearTempDir(); 105 file = new File("C:\\ContentManager\\temp\\edit"); 106 if(!file.exists()) { 107 file.mkdir(); 108 } 109 file = new File("C:\\ContentManager\\temp\\preview"); 110 if(!file.exists()) { 111 file.mkdir(); 112 } 113 114 115 file = new File("C:\\ContentManager\\auths\\ContentManager"); 116 InputStream is = HarmoniseInformationManager.class.getResourceAsStream("/org/openharmonise/him/icons/files/ContentManager"); 118 FileOutputStream fo = null; 119 120 try { 121 fo = new FileOutputStream(file); 122 int nValue; 123 while((nValue=is.read())!=-1) { 124 fo.write(nValue); 125 } 126 } catch (FileNotFoundException e) { 127 e.printStackTrace(); 128 } catch (IOException e) { 129 e.printStackTrace(); 130 } 131 132 133 135 } 136 137 } 138
| Popular Tags
|