1 26 27 28 package org.objectweb.openccm.descriptor.softpkg.ccm; 29 30 import org.objectweb.openccm.descriptor.ZipEntryRetriever; 32 import java.io.InputStreamReader ; 33 41 public class FileinarchiveDeployer 42 extends FileinarchiveDeployerContext 43 { 44 45 private ZipEntryRetriever zer; 51 57 63 69 73 public java.io.InputStreamReader 74 getInputStreamReader() 75 throws java.io.IOException 76 { 77 InputStreamReader isr=new InputStreamReader (getInputStream()); 78 getRootDeployerContext().connectOpenReader(isr); 79 return isr; 80 } 81 82 86 public java.io.InputStream 87 getInputStream() 88 throws java.io.IOException 89 { 90 if(getLinkDeployer()!=null) 91 return getLinkDeployer().getInputStream(); 92 return getZipEntryRetriever() 93 .getZipEntryISIgnoringDelimiterType(getFileinarchive().getName()); 94 } 95 96 102 public ZipEntryRetriever 103 getInnerArchive() 104 throws Exception 105 { 106 if(zer==null){ 107 zer=new ZipEntryRetriever(getInputStream()); 108 zer.connectStreamManager(getRootDeployerContext()); 109 } 110 111 return zer; 112 } 113 121 public String 122 startHttpServer() 123 throws java.io.IOException 124 { 125 126 (new Thread 127 (new org.objectweb.openccm.deploytool.MicroServerHttp 128 (getServerSocket(), 129 getInputStream(), 130 getFileinarchive().getName().trim()))).start(); 131 return 132 "http://" + 133 java.net.InetAddress.getLocalHost().getHostAddress() + ':' + 134 getServerSocket().getLocalPort() + '/' + 135 getFileinarchive().getName().trim(); 136 } 137 138 141 public String 142 provideRessource() 143 throws java.io.IOException 144 { 145 if(getLinkDeployer()!=null) 146 return getLinkDeployer().getReference(); 147 else return startHttpServer(); 148 } 149 150 } 151 | Popular Tags |