PK gE: META-INF/PK fE:4yffMETA-INF/MANIFEST.MFManifest-Version: 1.0 Ant-Version: Apache Ant 1.7.1 Created-By: 11.0-b16 (Sun Microsystems Inc.) PK gE:WEB-INF/PK gE:WEB-INF/classes/PK gE:WEB-INF/classes/com/PK gE:WEB-INF/classes/com/test/PK gE:=IJWEB-INF/classes/com/test/JSR88DeploymentHandler$DeploymentListener$1.class1K # $ %& '( )* +, )- . /0 /1234this$15DeploymentListener InnerClasses4Lcom/test/JSR88DeploymentHandler$DeploymentListener;7(Lcom/test/JSR88DeploymentHandler$DeploymentListener;)VCodeLineNumberTableLocalVariableTablethis6Lcom/test/JSR88DeploymentHandler$DeploymentListener$1;handleProgressEvent5(Ljavax/enterprise/deploy/spi/status/ProgressEvent;)Vevent2Ljavax/enterprise/deploy/spi/status/ProgressEvent; SourceFileJSR88DeploymentHandler.javaEnclosingMethod   67 89: ;<= >?@ AB CD EFG HI JI4com/test/JSR88DeploymentHandler$DeploymentListener$1java/lang/Object3javax/enterprise/deploy/spi/status/ProgressListener2com/test/JSR88DeploymentHandler$DeploymentListener()Vjava/lang/SystemoutLjava/io/PrintStream;0javax/enterprise/deploy/spi/status/ProgressEventgetDeploymentStatus7()Ljavax/enterprise/deploy/spi/status/DeploymentStatus;3javax/enterprise/deploy/spi/status/DeploymentStatus getMessage()Ljava/lang/String;java/io/PrintStreamprintln(Ljava/lang/String;)V isCompleted()Zdriver!Lcom/test/JSR88DeploymentHandler;com/test/JSR88DeploymentHandlersetError(Z)V setAppStarted  4 *+*7  v2++* * ;=>&?1B22 !"/ PK gE:* HWEB-INF/classes/com/test/JSR88DeploymentHandler$DeploymentListener.class1 A B C D EF GH IJ KL IM NO PQ RS RTU V WX RYZ \ ]^ N_ N`a bc b Idefgdriver!Lcom/test/JSR88DeploymentHandler; warContextLjava/lang/String;this$0W(Lcom/test/JSR88DeploymentHandler;Lcom/test/JSR88DeploymentHandler;Ljava/lang/String;)VCodeLineNumberTableLocalVariableTablethisDeploymentListener InnerClasses4Lcom/test/JSR88DeploymentHandler$DeploymentListener;handleProgressEvent5(Ljavax/enterprise/deploy/spi/status/ProgressEvent;)V startProgress3Ljavax/enterprise/deploy/spi/status/ProgressObject;id,Ljavax/enterprise/deploy/spi/TargetModuleID;arr$-[Ljavax/enterprise/deploy/spi/TargetModuleID;len$Ii$idsmyIDsex!Ljava/lang/IllegalStateException;8Ljavax/enterprise/deploy/spi/exceptions/TargetException;event2Ljavax/enterprise/deploy/spi/status/ProgressEvent; SourceFileJSR88DeploymentHandler.java # $h  !"i jkl mno pqr st uvw xyz {|} ~ *javax/enterprise/deploy/spi/TargetModuleID q 4com/test/JSR88DeploymentHandler$DeploymentListener$1 $ java/lang/IllegalStateException h6javax/enterprise/deploy/spi/exceptions/TargetException v2com/test/JSR88DeploymentHandler$DeploymentListenerjava/lang/Object3javax/enterprise/deploy/spi/status/ProgressListener()Vjava/lang/SystemoutLjava/io/PrintStream;0javax/enterprise/deploy/spi/status/ProgressEventgetDeploymentStatus7()Ljavax/enterprise/deploy/spi/status/DeploymentStatus;3javax/enterprise/deploy/spi/status/DeploymentStatus getMessage()Ljava/lang/String;java/io/PrintStreamprintln(Ljava/lang/String;)V isCompleted()Zcom/test/JSR88DeploymentHandlergetDeploymentManager1()Ljavax/enterprise/deploy/spi/DeploymentManager;)javax/enterprise/deploy/shared/ModuleTypeWAR+Ljavax/enterprise/deploy/shared/ModuleType;-javax/enterprise/deploy/spi/DeploymentManager getTargets'()[Ljavax/enterprise/deploy/spi/Target;getNonRunningModules(Ljavax/enterprise/deploy/shared/ModuleType;[Ljavax/enterprise/deploy/spi/Target;)[Ljavax/enterprise/deploy/spi/TargetModuleID; getModuleIDjava/lang/Stringequals(Ljava/lang/Object;)Zstartb([Ljavax/enterprise/deploy/spi/TargetModuleID;)Ljavax/enterprise/deploy/spi/status/ProgressObject;7(Lcom/test/JSR88DeploymentHandler$DeploymentListener;)V1javax/enterprise/deploy/spi/status/ProgressObjectaddProgressListener8(Ljavax/enterprise/deploy/spi/status/ProgressListener;)VsetError(Z)V setAppStartedprintStackTraceisFailed  !"# $%&^*+**,*-'& '()( ), !"-.& ++ * *  MN,:66D2:*&-S* -:Y***OM,**7M,**+**'n-/172<3U4f5k6z73FGSHJLMSNOQRSTUVY(p z/0U412?P34DK56GH767h84<c94:;:<),=>?@+N*PK gE:B&&JWEB-INF/classes/com/test/JSR88DeploymentHandler$UnDeploymentListener.class1L $ % & ' () *+ ,- ./ ,0 12 13 ,4567driver!Lcom/test/JSR88DeploymentHandler; warContextLjava/lang/String;this$0W(Lcom/test/JSR88DeploymentHandler;Lcom/test/JSR88DeploymentHandler;Ljava/lang/String;)VCodeLineNumberTableLocalVariableTablethisUnDeploymentListener InnerClasses6Lcom/test/JSR88DeploymentHandler$UnDeploymentListener;handleProgressEvent5(Ljavax/enterprise/deploy/spi/status/ProgressEvent;)Vevent2Ljavax/enterprise/deploy/spi/status/ProgressEvent; SourceFileJSR88DeploymentHandler.java  8  9 :;< =>? @AB CD EFG HI JI KF4com/test/JSR88DeploymentHandler$UnDeploymentListenerjava/lang/Object3javax/enterprise/deploy/spi/status/ProgressListener()Vjava/lang/SystemoutLjava/io/PrintStream;0javax/enterprise/deploy/spi/status/ProgressEventgetDeploymentStatus7()Ljavax/enterprise/deploy/spi/status/DeploymentStatus;3javax/enterprise/deploy/spi/status/DeploymentStatus getMessage()Ljava/lang/String;java/io/PrintStreamprintln(Ljava/lang/String;)V isCompleted()Zcom/test/JSR88DeploymentHandlersetError(Z)VsetAppUndeployedisFailed ^*+**,*-a bcd K++ * * + * * "hjk#l.m:nBoJqKK !"#  1PK gE:%r 5WEB-INF/classes/com/test/JSR88DeploymentHandler.class1G N N V N N G N N N   N      N N   % ' )  - N 1 N  7 N V N V N  G G  N )   N N  UnDeploymentListener InnerClassesDeploymentListenerdeploymentManager/Ljavax/enterprise/deploy/spi/DeploymentManager; appStartedZ appUndeployedisError warContextLjava/lang/String; warFilenamewsdlUrlloaderLjava/lang/ClassLoader; SyntaxHelp ConstantValuePropertiesFilename deploymentPropertiesLjava/util/Properties;writerLjava/io/PrintStream; errWritersetError(Z)VCodeLineNumberTableLocalVariableTablethis!Lcom/test/JSR88DeploymentHandler;error setAppStartedsetAppUndeployedgetParam&(Ljava/lang/String;)Ljava/lang/String;paramgetDeploymentManager1()Ljavax/enterprise/deploy/spi/DeploymentManager;dfClassLjava/lang/Class; dfInstance9Ljavax/enterprise/deploy/spi/factories/DeploymentFactory;ex"Ljava/lang/ClassNotFoundException;"Ljava/lang/IllegalAccessException;"Ljava/lang/InstantiationException;KLjavax/enterprise/deploy/spi/exceptions/DeploymentManagerCreationException;dfmCLjavax/enterprise/deploy/shared/factories/DeploymentFactoryManager;runApp'(Ljava/lang/String;Ljava/lang/String;)Vid,Ljavax/enterprise/deploy/spi/TargetModuleID;arr$-[Ljavax/enterprise/deploy/spi/TargetModuleID;len$Ii$idsmyIDs!Ljava/lang/IllegalStateException;8Ljavax/enterprise/deploy/spi/exceptions/TargetException;redeploytmIds deplProgress3Ljavax/enterprise/deploy/spi/status/ProgressObject; Exceptions undeployApp(Ljava/lang/String;)V startProgressreleaseDeploymentManager()VwaitForAppStarte Ljava/lang/InterruptedException;iwaitForAppUndeployment getWriter()Ljava/io/PrintStream;0(Ljava/lang/ClassLoader;Ljava/util/Properties;)Vprops setProperties(Ljava/util/Properties;)VprintHelpAndExit deployApp warFileNamewarFiledeploymentHandlercontext SourceFileJSR88DeploymentHandler.java _] \]  ^] jk z Z[  dejsr88.df.classname yz  7javax/enterprise/deploy/spi/factories/DeploymentFactory  java/lang/ClassNotFoundException nm  java/lang/IllegalAccessException java/lang/InstantiationException jsr88.dm.id jsr88.dm.userjsr88.dm.passwd |Ijavax/enterprise/deploy/spi/exceptions/DeploymentManagerCreationException wp*javax/enterprise/deploy/spi/TargetModuleID |}  !" #$ %&' ()java/lang/IllegalStateException 6javax/enterprise/deploy/spi/exceptions/TargetException java/io/File *+ ,2com/test/JSR88DeploymentHandler$DeploymentListener -. /0 java/lang/ExceptionDeployment failed. xp 1$ 234com/test/JSR88DeploymentHandler$UnDeploymentListener Undeployment failed. 4 5java/lang/InterruptedException 63 lm 7 8m 9m ,syntax: deploy undeploy : ; <=java/util/Properties&deployer:Sun:AppServer::localhost:4848 >?admin adminadmin1com.sun.enterprise.deployapi.SunDeploymentFactorycom/test/JSR88DeploymentHandler @A B& CD EF java/lang/Objectwardeployment.properties notifyAll getPropertyAjavax/enterprise/deploy/shared/factories/DeploymentFactoryManager getInstanceE()Ljavax/enterprise/deploy/shared/factories/DeploymentFactoryManager;java/lang/ClassLoader loadClass%(Ljava/lang/String;)Ljava/lang/Class;java/lang/Class newInstance()Ljava/lang/Object;registerDeploymentFactory<(Ljavax/enterprise/deploy/spi/factories/DeploymentFactory;)VprintStackTrace(Ljava/io/PrintStream;)Vg(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljavax/enterprise/deploy/spi/DeploymentManager;)javax/enterprise/deploy/shared/ModuleTypeWAR+Ljavax/enterprise/deploy/shared/ModuleType;-javax/enterprise/deploy/spi/DeploymentManager getTargets'()[Ljavax/enterprise/deploy/spi/Target;getAvailableModules(Ljavax/enterprise/deploy/shared/ModuleType;[Ljavax/enterprise/deploy/spi/Target;)[Ljavax/enterprise/deploy/spi/TargetModuleID; getModuleID()Ljava/lang/String;java/lang/Stringequals(Ljava/lang/Object;)Z distributev([Ljavax/enterprise/deploy/spi/Target;Ljava/io/File;Ljava/io/File;)Ljavax/enterprise/deploy/spi/status/ProgressObject;~([Ljavax/enterprise/deploy/spi/TargetModuleID;Ljava/io/File;Ljava/io/File;)Ljavax/enterprise/deploy/spi/status/ProgressObject;W(Lcom/test/JSR88DeploymentHandler;Lcom/test/JSR88DeploymentHandler;Ljava/lang/String;)V1javax/enterprise/deploy/spi/status/ProgressObjectaddProgressListener8(Ljavax/enterprise/deploy/spi/status/ProgressListener;)VgetRunningModulesundeployb([Ljavax/enterprise/deploy/spi/TargetModuleID;)Ljavax/enterprise/deploy/spi/status/ProgressObject;releasewaitstartjava/lang/Systemouterrjava/io/PrintStreamprintlnexit(I)Vput8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;getClassLoader()Ljava/lang/ClassLoader;getNamelength()I substring(II)Ljava/lang/String;!NV Z[\]^]_]`abacadefagDhagijklmnm opq>*r ~stuv] wpqF **r s tu \] xpqF **r s tu ^]yzqI* *+rstu{a|}qNv*lL* * M, N+-$M,*M,* M,**+* * *  M,** '* '6 'BKehrN "'*+367?BCKehiqsR ~"+7Ci evtuq *>:* *!":::66  / 2: , #$ S> S Ч:& :(:#**!)Y+*+:*)Y+*,:-Y**,./*,0* 1Y23 il% iv'rn $*DRXZ`cilnsvx}sD .;3663 $E*?nxtuba`a] b1q{ *4* *!5MN,:66@2:+#$%-S*-6:7Y**+8/M,&M,(*9* 1Y:3or%oz'rN 9GLXiorswz{sp X90#L(G+DT Os{tu`a1qD* *;rs tu qG}***>,,2#+$ *Y,2S>WN-&N-(= lo% lw'rR 68@O RX lo ptwx|sH84px6F}tu}`a qj****+r ?@stuk q- ADEFrCD E qgGYHL+IJW+KJW+LJW+ MJWNYNO+PMN-)Y**Q:RdSN,*-T,Ur6 HIJK#L,O;P=RASNT\WbXfYs4Naga_k;,u=*a1X7NW-NYPK gE:n WEB-INF/sun-web.xml /FileUpload Keep a copy of the generated servlet class' java code. PK gE:VJ4WEB-INF/web.xml 30 index.jsp PK gE:ppfileupload.jsp<%@ page import="java.io.*,com.test.*" %> <% //to get the content type information from JSP Request Header String contentType = request.getContentType(); if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) { DataInputStream in = new DataInputStream(request. getInputStream()); //we are taking the length of Content type data int formDataLength = request.getContentLength(); byte dataBytes[] = new byte[formDataLength]; int byteRead = 0; int totalBytesRead = 0; //this loop converting the uploaded file into byte code while (totalBytesRead < formDataLength) { byteRead = in.read(dataBytes, totalBytesRead, formDataLength); totalBytesRead += byteRead; } String file = new String(dataBytes); //for saving the file name String saveFile = file.substring(file.indexOf("filename=\"") + 10); saveFile = saveFile.substring(0, saveFile.indexOf("\n")); saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\"")); int lastIndex = contentType.lastIndexOf("="); String boundary = contentType.substring(lastIndex + 1, contentType.length()); int pos; //extracting the index of file pos = file.indexOf("filename=\""); pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; int boundaryLocation = file.indexOf(boundary, pos) - 4; int startPos = ((file.substring(0, pos)).getBytes()).length; int endPos = ((file.substring(0, boundaryLocation)) .getBytes()).length; FileOutputStream fileOut = new FileOutputStream(saveFile); fileOut.write(dataBytes, startPos, (endPos - startPos)); fileOut.flush(); fileOut.close(); %>
You have successfully upload the file by the name of: <% out.println(new File(saveFile).getAbsolutePath()); %>
<% JSR88DeploymentHandler.deployApp(saveFile); } %>PK gE:|  index.jsp<%@ page language="java" %> Display file upload form to the user



PROGRAM FOR UPLOADING THE FILE

Choose the file To Upload:

PK gE: AMETA-INF/PK fE:4yff+META-INF/MANIFEST.MFPK gE:AWEB-INF/PK gE:AWEB-INF/classes/PK gE:AWEB-INF/classes/com/PK gE:AIWEB-INF/classes/com/test/PK gE:=IJWEB-INF/classes/com/test/JSR88DeploymentHandler$DeploymentListener$1.classPK gE:* HWEB-INF/classes/com/test/JSR88DeploymentHandler$DeploymentListener.classPK gE:B&&JjWEB-INF/classes/com/test/JSR88DeploymentHandler$UnDeploymentListener.classPK gE:%r 5WEB-INF/classes/com/test/JSR88DeploymentHandler.classPK gE:n  =WEB-INF/sun-web.xmlPK gE:VJ4=?WEB-INF/web.xmlPK gE:ppTAfileupload.jspPK gE:|  Hindex.jspPK4K