shirish katti

Ranch Hand
+ Follow
since Nov 09, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shirish katti

Hi Rob,

I have even tried it with flushing the file...

As per my knowledge flushing doesn't guarantees that the content is written to the physical disk...

I made this code time efficient, but the problem of output file of 0kb still remains the same..

12 years ago
Hi Rob,

Thanks for your prompt reply...

Thanks for make it time efficient...

Lines 114 and 130 cause your loop to break off immediately. You're join method looks for files without the ".sp" extension. If you use line 111 instead of line 112 the program actually runs.

sorry for this actually i had used line 111 itself...

Even joining is working but the thing is the joined file shows as 0kb and when i use win zip to open it.. It opens and works fine only until i keep the source file i mean the original file in the same location if i delete the source file then it doesn't work properly..

In short it gets redirected to the source file.. Any idea..
12 years ago
Hi all,

I am developing an application into which i need to split a huge zip file into 4 to 5 parts and then rejoin it...

I have tried this with the code i have attached...

The splitting part works perfectly.. Even the re joining part works but the rejoined file is of 0kb with no content into it...

Any of you free then please execute this code snippet and let me know if you have any solution...

Thanks in Advance..
12 years ago

Shirish, that will only work when the file is always located in the same folder. You can't assume that the application has been started in its root folder, or the folder where the JAR file is located. Resources are always relative to a class or the entire class path, so those seem more appropriate.

Hi Rob,

Yes if the location of file changes, then we do have properties file were we can change the path of the file to be read..

If you do have any proper solution than this then please share it..
12 years ago
I prefer head first java , from where i really got a catch of generics..
Using java it is very easy..

You can get the path of a file as below

File f=new File("fileName");
12 years ago
Hi chandana Try out with this..


public class FilePath {
public static void main(String[] args) {
FileInputStream fs=new FileInputStream("Path to your Xsl file");
DataInputStream in=new DataInputStream(fs);
BufferedReader br=new BufferedReader(new InputStreamReader(in));
String strLine;
}catch(Exception e){

I am sure it will work as it worked for me.. Enjoyyyyyyyy..........
12 years ago
Paul----Ehm...they can - I'm currently doing this! FlexBuilder is just an eclipse plugin. If you already have an eclipse install for your Java development, just add the FlexBuidler plugin to that and you can swap between perspectives to develop Java and ActionScript/MXML.

Is it ? If so then thats great i will try to plug in flexBuilder into eclipse.. Anyways thanks..
12 years ago
Hi david, yes you are right that java is rigid language with impoverished model.. But it would have been great for java developers if java and GUI both could be developed in FlexBuilder.. Anyways its not a big deal..
12 years ago
I even tried a lot with ZipInputStream and was totaly lost..
12 years ago
Hi Bob, I am trying with the same code you posted to unzip a file.. But its not working its throwing an exception as too many entries in zip file can you please help me..
12 years ago
Hi guys here is the code with which i am trying to unzip a zipped file (Not to be done manually )

package com.unix;

import java.util.Enumeration;

public class Unzip {

/** Unzipp a Zip */
public Unzip(){}

public static void main(String args[]) throws IOException {

String inDirectory="C:\\searchResult";
String outDirectory="images/";

String[] filenames;
//String[] files=null;

File file = new File(inDirectory);
filenames =file.list();


for(int i=0; i< filenames.length; i++) { //Don't forget this!!
File fs= new File(file.getName() + File.separator + filenames[i]);
System.out.println("File Name: " + fs);
System.out.println("Get Zip File: " + filenames[i]);

------------------------------------------------------------------------ZipFile f=new ZipFile(inDirectory+"\\"+ filenames[i]);
showing exception on the above line as too many entries

System.out.println("Got ZipFile:"+f);
Enumeration entries= f.entries();
System.out.println("Decompressing Data");


ZipEntry entry=(ZipEntry) entries.nextElement();

InputStream in = f.getInputStream(entry);
FileOutputStream out = new FileOutputStream(outDirectory +
"" + entry.getName());

for(int;ch!=-1; out.write(ch);
} //end while
} // end for
try {
} catch(Exception e) {
System.out.println("Unzipping Completed Successfully.");
} //end main
} //end class

After running this code i am getting:

File Name: searchResult\
Get Zip File:
Exception in thread "main" too many entries in ZIP file
at Method)
at com.unix.Unzip.main(

Can any one help me ???
12 years ago
Surely, there will be no more duplications..
12 years ago