redirect port 80 to 8080 on server.

– On site AWS , in Security Group after we redirect port 80 to 8080 we will block port 8080 on AWS.

Untitled
——

Example: http://192.168.1.234:8080/

After use command we just go to http://192.168.1.234

– With port 8434 (https).

 

Maven build jar file : mvn clean package

 

Ant build xml sample.

 

Maven build single jar file in eclipse.

  • Convert project to maven.
  • Add plugin maven compiler in file pom.xml

  •  After build, file jar will be in folder target.

Link Full : http://maven.apache.org/plugins/maven-assembly-plugin/usage.html

Create zip file from multiple files with ZipOutputStream

With this example we are going to demonstrate how to create a zip file from multiple Files with ZipOutputStream, that implements an output stream filter for writing files in the ZIP file format. In short, to create a zip file from multiple Files with ZipOutputStream you should:

  • Create a FileOutputStream to write to the file with the specified name, that is the zipFile.
  • Create a new ZipOutputStream from the FileOutputStream, that is an output stream filter for writing files in the ZIP file format.
  • For each one of the Files create a new File instance by the given pathname of the file.
  • Create a FileInputStream by opening a connection to the file.
  • Create a new ZipEntry with the name of the File and begin writing it to the ZipOutputStream. The default compression method will be used if no compression method was specified for the entry.
  • Read up to 1024 bytes of data from the file into an array of bytes, using the read(byte[] b) API method of FileInputStream and write the data to the current ZipEntry data, using write(byte[] b, int off, int len) method of ZipOutputStream.
  • Always remember to close the ZipEntry, the ZipOutputStream and the FileInputStream, using closeEntry() and close() API methods respectively.

Continue reading Create zip file from multiple files with ZipOutputStream