Create your own File Splitter Joiner

0

Whats up readers ? This post describes how to create your own File Splitter Joiner in Java. You might be thinking about its application. So I’ll first of all describe situations in which you can think of using this utility.

Suppose you need to send a large file (>1GB) to somebody on the internet. If there was no option to split the file, you will have to upload the entire file in a single go. Moreover, it would be cumbersome for the person on the other side because he/she will have to download the entire file in one go and only few file hosting sites provide resumable download. So in short, its a great headache for both of you. But using these utilities, you can split the file before sending and the person on other side can merge (join) those splitted files to get the original file.

For people from non-java background, java newbies, or people willing to test utility, you can download and try the JAR file from here. You need JRE/JDK installed before running this application (JRE link, JDK link). For better user interface, make sure that SegoeUI font is installed in your system (comes pre-installed with windows 7 and 8)

Features of this utility are :

1. Portability :  It is written 100% in Java, so is platform independent. The GUI is written in Swing.

2. Speed : Its speed is faster than or equal to all those freeware utilities which are available on internet. (I have tested two most popular, HJ Split and File Splitter).

3. Simplicity : It has a simple and elegant User Interface and is easy to use.

4. License : Its free and open source. Its your own, so you can extend it anytime. (source available on github).

Java basics/packages used in this application are:

1. java.io package / Reading and Writing files : java.io package consists of those classes which are used for reading / writing data from disk,console and network. The best thing about java is that the same class which reads data from console (window) can be used to read from the file or network also. I have used FileInputStream and FileOutputStream classes which are byte stream buffered input classes. From this, I mean that these classes read files byte by byte and they read data in a buffer. Reading data in buffer reduce the no. of ‘reads’ from the file, thus increasing the speed of operation.

2. javax.swing package / User Interface package : This package contains a rich collection of GUI classes. I have used Buttons, Labels, Checkboxes, TextFields, ProgressBars etc in this application. The layout used in this application is GridBagLayout. It is the most complex and flexible layout in Java. Other classes used from this package are frames (main windows), panels, classes to set color, font and other properties.

3. Multithreading : Executing more than one thread inside a single application is called Multithreading. This software uses multithreading for doing some operations. All the GUI related loading and updation is done on a separate thread called event dispatching thread (EDT) and other operations are performed on separate threads.

The code is thoroughly documented, so you can refer the comments if you don’t understand something. The source code consists of 9 .java files, so I have not uploaded them here. The complete source code is uploaded on github. You can download the zip and include in Eclipse (Import -> General -> Existing project into workspace->Locate Zip file).

Working software link

Some screenshots of the working software :

1 2 3 4 5 6 7 8 9

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge