JFileChooser interpreting zip file as a folder

I have an app that reads and writes data to zip files. When opening one, I use a JFileChooser with a file filter for zips and directories.
This works fine except except on XP. If the zip file is on a remote (Novell) file server, the JFileChooser treats the zip file as a directory. You can't open the zip file itself.
If the client is W2k, there is no problem.
I'm using JRE 1.4.1.
Anyone know if there's a tweak to XP to fix this?

JResourceBrowser is a swing component similar to the javax.swing.JFileChooser but letting the user navigating into a set of directories bound to various protocols or containers. For an usage sample, listing an ftp directory, creating a new file and editing it inside your application. JResourceBrowser is provided by default with a set of "managers" dedicated to ZIP and JAR, FTP and WebDAV.
http://www.swingall.com/jrb/index.html
Features :
* JavaBeans
* Built with a GridBagLayout
* Create your own plugins for navigating
* User Interface delegate for rendering a file
* Cutomize the set of actions
* Default actions for creating a new file, deleting, renaming or locking/unlocking
* Extracting or putting a file content
* Save/restore the user interface state
* ZIP, JAR support
* FTP support
* WebDAV support
* JDK 1.4 and 1.5 compatibility

Similar Messages

  • Saved presentation as .zip file or a folder. Presentation gone?

    Hello, I really need some help. Yesterday, I worked with a presentation which took about 10 hours, I'm not really that experienced with computers, but I think I saved it as a .zip file or simply as a folder. I cannot find the presentation and open it anymore, and the .zip file and the folder simply contains:
    All the images i used in the presentation.
    A folder named "Quicklook".
    A folder named "Thumbnails", with all the thumbnails of each slide, but they are too small to read, and it doesn't help to zoom in, too bad quality.
    The frontpage of my presentation.
    A file named "Index", not sure about the filetype.
    I really need help on how to fix this, if it is possible. I don't understand where the main file for the presentation is, it seems like this folder only contains all the materials and parts for the presentation.
    Any ideas?
    Thanks in advance.

    Welcome to the discussions, Maryam222.
    Keynote "files" are actually .zip files or folders with the difference being that their name has .key on the end. As long as you haven't moved any of the items/objects out of OR to different positions in that folder, you should be able to...
    1) Select the icon that you think is your presentation (not the stuff on the inside, the folder that it's all in, select the folder)
    2) Do "command-I" to "Get Info" for that icon.
    3) In the "Name & Extension" area, you should see the name of the folder
    4) I'm guessing that your problem is that it doesn't have .key at the end. So, add .key to the end of the filename (If it has .zip at the end, change .zip to .key)
    5) OSX will tell you something about changing the file, click the button to confirm the change
    Now, it should open in Keynote when you double click on it. If not, post back to report what you're seeing.

  • Zipping files in a folder using java.util.zip

    hi guys,
    does any body has the java code for
    zipping files in a folder
    hi guys,
    actually i want to zip no of files in a folder .the folder can also have sub folder
    and after zipping when i extract the files manually i should
    maintain the same folder structure
    does any body has the code
    please reply me soon its a bit urgent

    hi smeee
    i tried running ur code but its not working
    here the command
    java c:\abc\ zzz.zip
    its saying
    no files or directories even though there's the
    directory present
    what's the solution Hi,
    Oops that was because of the error check added at the last moment..
    Anyway, You need to use the following command to run it :
    java ZipUtility c:\abc c:\zzz.zip
    Please use the following corrected code:
         Class to zip file(s).
         Requires jdk1.3.1.
         To run use the following command:
         java ZipUtility <directory or file to be zipped> <name of zip file to be created>
         Please specify absolute path names as its parameters while running this program.
    import java.util.zip.*;
    import java.io.*;
    public class ZipUtility {
         ZipOutputStream cpZipOutputStream = null;
         String strSource = "";
         String strTarget = "";
         String strSubstring = "";
         public static void main(String args[]) {
              if(     args == null || args.length < 2) {
                   System.out.println("Usage: java ZipUtility <directory or file to be zipped> <name of zip file to be created>");
                   return;
              ZipUtility udZipUtility = new ZipUtility();
              udZipUtility.strSource = args[0];
              udZipUtility.strTarget = args[1];
              udZipUtility.zip();
         private void zip(){
                        try
                             File cpFile = new File (strSource);
                             if (!cpFile.isFile() && !cpFile.isDirectory() ) {
                                  System.out.println("\nSource file/directory Not Found!");
                                  return;
                             if  (cpFile.isDirectory()) {
                                  strSubstring = strSource;;
                             } else {
                                  strSubstring = "";
                             cpZipOutputStream = new ZipOutputStream(new FileOutputStream(strTarget));
                             cpZipOutputStream.setLevel(9);
                             zipFiles( cpFile);
                             cpZipOutputStream.finish();
                             cpZipOutputStream.close();
                             System.out.println("\n Finished creating zip file " + strTarget + " from source " + strSource);
                        }catch (Exception e){
                             e.printStackTrace();
         private void  zipFiles(File cpFile) {
                   if (cpFile.isDirectory()) {
                        File [] fList = cpFile.listFiles() ;
                        for (int i=0; i< fList.length; i++){
                             zipFiles(fList) ;
                   } else {
                        try {
                             String strAbsPath = cpFile.getAbsolutePath();
                             String strZipEntryName ="";
                             if (!strSubstring.equals("") ){
                                  strZipEntryName = strAbsPath.substring(strSource.length()+1, strAbsPath.length());
                             } else {
                                  strZipEntryName = cpFile.getName();
                             byte[] b = new byte[ (int)(cpFile.length()) ];
                             FileInputStream cpFileInputStream = new FileInputStream (cpFile) ;
                             int i = cpFileInputStream.read(b, 0, (int)cpFile.length());
                             ZipEntry cpZipEntry = new ZipEntry(strZipEntryName);
                             cpZipOutputStream.putNextEntry(cpZipEntry );
                             cpZipOutputStream.write(b, 0, (int)cpFile.length());
                             cpZipOutputStream.closeEntry() ;
                        } catch (Exception e) {
                             e.printStackTrace();

  • Pickup and process zip file in watch folder

    Hi,
    Could someone refer me to an example where it shows me how to use Java script in the Execute Script service to do the following:
    - Pickup the zip file from the Watch Folder
    - Unzip the zip file
    - Loop through all the folders, look for the documents and store them in the list document variable in the process
    Thank you in advance for the help!
    Hai

    You can certainly remove that file. it's basically the cached applet demo.jar (the JRE caches the downloaded jars so that you don't have to keep re-downloading them each time you visit the web site).
    The fact that your Antivirus complains about it just means that it's confused. We're all using the Sun environment, and I have the latest and greatest Norton, and there are no complaints, so it's clear that your Antivirus software needs a fix.

  • Possible trojan .zip file in jar folder

    Has anyone heard of the possibility of an infected "jar" file in the
    J2SE v.1.4.2_03 application?
    I have recently installed Sun during an XP Pro install due to the regulations that don't allow Microsoft to monopolize the Java Machine anymore, and now I have received a message from my Virus software that the demo.jar-2e26db2e-6e6164b1.zip file residing in
    C:\Documents and Settings\Owner\Application Data\Sun\Java\Deployment\cache\javapi\v1.0\jar has been detected as an uncleanable trojan. It needs to replaced. Any bulletins about this or help in obtaining another file, (if it's needed to have the application function properly), would be appreciated.

    You can certainly remove that file. it's basically the cached applet demo.jar (the JRE caches the downloaded jars so that you don't have to keep re-downloading them each time you visit the web site).
    The fact that your Antivirus complains about it just means that it's confused. We're all using the Sun environment, and I have the latest and greatest Norton, and there are no complaints, so it's clear that your Antivirus software needs a fix.

  • Zip files in AdobePatchFiles folder

    I have 2 GB of zip files in Applications/Adobe/AdobePatchFiles generated by Creative Cloud (Mac OSX 10.9.2). Can I delete them?

    you need those files for future patches.
    in general, before deleting files you're not certain you can delete, rename them. (i like to prefix the file name with a dollar sign, $.  that moves the file to the top of the directory listings and makes it easy to rename back to the original if there's a problem.)

  • How to create a Web Dynpro Project from Downloaded zip file?

    Hi,
    I have been working in Java Web Dynpro for last 1 month but not able
    to create any Web Dynpro from Downloaded zip file?
    Can anybody tell me how to create a Java Web Dynpro Project from
    Donloaded zip code?
    Regards
    Kaushik Banerjee

    Hi Kaushik,
    You can add the existing zip file into your workspace by the following way -
    First open the NWDS and create a new project by clicking file -> new -> Project -> Simple -> Project
    and then File -> Import -> zipfile and then browse the zip file into the newly created project.
    or else you can also unzip the zip file into a folder and then Use the option of Import an exisitng project into workspace. You can find this in the File-> import -> Existing project into workspace. and then use the Browse option to browse to the existing folder.
    After importing the project you need to rebuild the project
    Regards,
    Raju Bonagiri.

  • Reading ZIP files

    Is it possible to read content of ZIP files.
    Iam using ORACLE forms 6i.
    In our company, we are creating a zip file with two folder src and lib, where SRC contains FMB files abd LIB contains PLLfiles.Now i want to know whether instead of us seeing the contents, is it possible to check whether fmx and plx are present in correspoding folder using some api methods.
    If u can find any please tell me .. it will be of great use

    I dont about the api's, but one way cud be unzipping the files in temp folder thru winzip command line and then checking the files existence.

  • Zip file created in Snow Leopard can't be opened on a PC

    Hi,
    I've created a zip file of a folder containing Word and pdf files using File>Compress in Snow Leopard.
    After emailing to clients, they cannot open the zip file on their PCs.
    Any help? I thought zip was supposed to be universal.
    Thanks in advance!

    All clients, or some clients? How big are the zip files?
    Usually when this happens, one of two things is going on: one of your mail servers is truncating the message (cutting off part of the attachment) because the message exceeds some pre-determined maximum message size (or the mailbox goes over a quota), OR one of you is running a virus/malware scanner on your mail server that objects to certain file types (it's not uncommon to strip .ZIP, .COM, and .EXE files).
    There's also the possibility that a Windows client just doesn't understand the file's type. While that shouldn't be, it does happen sometimes (I've seen it with Lotus Notes, for example). In that case, the recipient should save the attachment as a file on their desktop and open it from the desktop.

  • Problem in unzipping the zip files

    Hi,
    I have created a program to unzip the zip files. But when i try to zip it is creating the zipped files outside the folder where it is to be zipped.
    what is wrong with my code.
    if the zip file is migration.zip
    if the path inside the zip file shows
    and the path inside says this
    /codebase/scripts/
    it would create migration folder and create codebase folder outside the migration folder
    what is wrong with my code
    //Unzip the zip files to the folder with their name
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.FilenameFilter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Enumeration;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
    // Getting the path to find the type of files
    public class zipper implements FilenameFilter{
              String ext;
              public zipper(String ext)
                   this.ext="." + ext;
              public boolean accept(File dir,String name)
                   return name.endsWith(ext);
    public static void main(String args[]) throws IOException
              try
                        String dir = "D:/a/";
                        File f2 = new File(dir);
                        FilenameFilter fn= new zipper("zip");
                        String ss[]=f2.list(fn);
                   for ( int j = 0; j < ss.length; j++)
                        System.out.println(" Extracting ...." + ss[j]) ;
                        String zipFile = dir + ss[j];
                        ZipFile zf = new ZipFile(zipFile);
                        Enumeration entries = zf.entries();
                        String directoryName = zf.getName();
                        directoryName = directoryName.substring(0, (directoryName.indexOf(":" + File.separator) + 2));
                             String folderName = zf.getName();
                             folderName = folderName.substring(0, folderName.lastIndexOf("."));
                             File file1 = new File(folderName);
                             //File file1 = new File(entries.getName());
                             file1.mkdir();
                   while (entries.hasMoreElements())
                             ZipEntry ze = (ZipEntry) entries.nextElement();
                             String path = directoryName + ze.getName() ;
                             String path1 = folderName + ze.getName();
                             //System.out.println(" : " + path);
                             if (ze.getName().endsWith("/"))
                                       File file = new File(path);
                                       file.mkdir();
                                       continue;
                                       //break;
                        BufferedReader bReader = new BufferedReader(new InputStreamReader(zf.getInputStream(ze)));
         StringBuffer fileBuffer = new StringBuffer(" ");
         String line ;
                        while ((line = bReader.readLine()) != null)
                                  fileBuffer.append(line);
                                  fileBuffer.append("\r\n");
                                  //line = line + "\r\n";
                                  //byte[] b = new byte[line.length()];
                                  //b =line.getBytes();
                                  //out.write();
                        String fileData = fileBuffer.toString();
         File f1 = new File(path);
                        f1.createNewFile();
                        //FileOutputStream out = new FileOutputStream(folderName + "/" + ze.getName());
                        FileOutputStream out = new FileOutputStream(path);
                        long size = ze.getSize();
                        byte[] data1 = new byte[fileData.length()];
                        for (int i = 0; i < fileData.length(); i++)
                                  data1[i] = (byte) fileData.charAt(i);
         out.write(data1);
         out.close();
                        bReader.close();                         
                   } catch (Exception e)
                             e.printStackTrace();
    Thanks in Advance
    Avinash

    String path = directoryName + ze.getName();
    String path1 = folderName + File.separator+ ze.getName();
    File f1 = new File(path); // pass path1 instead of path
    f1.createNewFile();
    FileOutputStream out = new FileOutputStream(path); // pass path1 instead of path

  • Problem in Unzipping the zip file

    Hi
    I have created a program to unzip the zip files in the folder named after the zip file
    it is working well well when u try to zip zip files put in a directory
    i.e u create a folder name contents and put files into that and then zip it
    but when u directly create a zip file , without putting in a folder
    it creates the folder and zip the files outside the folder
    Another problem is that with the path
    for e.g. suppose the zip file name is contents and path should show
    contents/filename.txt but there are some other files whose path shows
    res/file.txt. In this case it creates a folder of res and put it outside the
    folder with the name of zip file
    I have pasted my code :
    //Unzip the zip files to the folder with their name
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.FilenameFilter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Enumeration;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
    // Getting the path to find the type of files
    public class zipper implements FilenameFilter{
              String ext;
              public zipper(String ext)
                   this.ext="." + ext;
              public boolean accept(File dir,String name)
                   return name.endsWith(ext);
    public static void main(String args[]) throws IOException
              try
                        String dir = "D:/";
                        File f2 = new File(dir);
                        FilenameFilter fn= new zipper("zip");
                        String ss[]=f2.list(fn);
                   for ( int j = 0; j < ss.length; j++)
                        System.out.println(" Extracting ...." + ss[j]) ;
                        String zipFile = dir + ss[j];
                        ZipFile zf = new ZipFile(zipFile);
                        Enumeration entries = zf.entries();
                        String directoryName = zf.getName();
                        directoryName = directoryName.substring(0, (directoryName.indexOf(":" + File.separator) + 2));
                             String folderName = zf.getName();
                             folderName = folderName.substring(0, folderName.lastIndexOf("."));
                             File file1 = new File(folderName);
                             //File file1 = new File(entries.getName());
                             file1.mkdir();
                   while (entries.hasMoreElements())
                             ZipEntry ze = (ZipEntry) entries.nextElement();
                             String path = directoryName + ze.getName() ;
                             String path1 = folderName + ze.getName();
                             //System.out.println(" : " + path);
                             if (ze.getName().endsWith("/"))
                                       File file = new File(path);
                                       file.mkdir();
                                       continue;
                                       //break;
                        BufferedReader bReader = new BufferedReader(new InputStreamReader(zf.getInputStream(ze)));
         StringBuffer fileBuffer = new StringBuffer(" ");
         String line ;
                        while ((line = bReader.readLine()) != null)
                                  fileBuffer.append(line);
                                  fileBuffer.append("\r\n");
                                  //line = line + "\r\n";
                                  //byte[] b = new byte[line.length()];
                                  //b =line.getBytes();
                                  //out.write();
                        String fileData = fileBuffer.toString();
         File f1 = new File(path);
                        f1.createNewFile();
                        //FileOutputStream out = new FileOutputStream(folderName + "/" + ze.getName());
                        FileOutputStream out = new FileOutputStream(path);
                        long size = ze.getSize();
                        byte[] data1 = new byte[fileData.length()];
                        for (int i = 0; i < fileData.length(); i++)
                                  data1[i] = (byte) fileData.charAt(i);
         out.write(data1);
         out.close();
                        bReader.close();                         
                   } catch (Exception e)
                             e.printStackTrace();
    Thanks in Advance
    Avinash

    String path = directoryName + ze.getName();
    String path1 = folderName + File.separator+ ze.getName();
    File f1 = new File(path); // pass path1 instead of path
    f1.createNewFile();
    FileOutputStream out = new FileOutputStream(path); // pass path1 instead of path

  • Is there a way to add a password to either a zipped file or a m4v file?

    Either using the apps that are included or any FREE app thanks

    Well, first, there are a couple caveats.  If you want to compress your home folder into an encrypted .zip file, you wouldn't want to place that .zip file on the desktop.  There could be problems with trying to put the .zip file inside the folder you are zipping!  I would put it at the root level of the hard drive instead.  Second, if this is something you want to do regularly, as a means for creating an encrypted backup of the home folder or something similar, this isn't a very efficient or easy method.  Creating such a large .zip file will take a long time, and it will have to be re-created from scratch every time you want to update the backup.  It would be better to use a specific tool for that task.
    However, all that said, to create a zip archive named cool.zip at the root level of the hard drive, containing the entire home folder, you would execute the following command:
    zip -e /cool.zip /Users/yourusername
    You should also be able to substitute '~' for your home folder path:
    zip -e /cool.zip ~
    If you wanted to create an archive of your Documents folder and place it on the desktop, to give another example, here's the command you would use:
    zip -e ~/Desktop/cool.zip ~/Documents
    Hope all that helps!

  • Zip files with passwords

    I recently created a zip file from a folder with photos. When I send this via email the recipients cannot open the file it ask for a password. I thought maybe it was because the recipient was using windows but since I have parallels on my machine I thought I would pull the file over to parallels windows and it refuses to do it. Any one have an idea that will help. I am new to the mac operating system.

    No I did not create a password and yes there is the .zip extension.
    I zipped the file due to the number of photos in the folder. My mac mail program only lets you attach photos individually and there was quite a few photos to send.
    What I don't get is why I cant drag a photo file into windows parallels. Each time i get a message saying it "cant copy the file: cannot read from source file or disk" this file is on my desktop on the mac side.

  • I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it.

    I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it. All of the files are going into the same zip file but I want them visually in the space that I put them and not at the bottom of the snap to grid folder location they are looking like.  I am trying to  drag and drop files in groups so that I can group them for now, but image files always do their own "sort by" when I drag them from my web pages. Links don't do it though.  I tried resetting the folder, and deleting the DS files. No luck.

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

  • Hello, I am attempting to install Camera raw from a .zip file provided via a link provided by adobe for a Nikon D810. The .zip file unzips fine and I moved the files to the recommended folder. But the operation is failing

    I am attempting to install Camera raw from a .zip file provided via a link provided by adobe for a Nikon D810. The .zip file unzips fine and I moved the files to the recommended folder. But the operation is failing

    Can you describe what “the operation is failing” means?  What is happening and how is it different than what you expect?
    Also, what product are you trying to update manually, and do you have a link to the page of instructions, so we know what your attempting to do?

Maybe you are looking for

  • Can I use Time Capsule for Time Machine and a place to put my iPhoto Library

    Can I use Time Capsule for Time Machine and a place to put my iPhoto Library?

  • Display files in a folder...

    Hello, all.  I'm using the stored procedure xp_dirtree to list the files (PDFs in my case) in a folder.  In Mgt Studio I correctly get the results.  However, I want to use the query results in an SSRS report so that the user can click on a report nam

  • LMS 3.1 Syslog Automated Action - How to pass variables to script?

    I would like to pass variables to a windows bat file for processing.  The help seems to suggest that there are 2 available, device and message.  I would like to know how to reference them and what syntax to use to pass them to the batch file.  Are Fa

  • How can I connect a digital compass to sbRIO 9631

    Support community we need your help. We found this question from Khaled through our Twitter account. We feel his question might warrant ample discussion so we have pointed himhere to the forums and created this thread for him. Is there anyone who can

  • Users saving half completed forms

    I have set up my enquiry form which our users complete and submit to me via a butoon (XML).  they are mainly using adobe reader to view the form.  If they are half way through the form and they wish to save it and continue filling it in later they ca