Opening a compressed folder (zip)

Help! I received an email from Taiwan and naturally the characters are in Chinese. I can use an online translation service, no problem, but there was an attachment that will not open. The computer indicates it is a compressed attachment and I have no idea how to open it. I am new to using a Mac and could find no help from the online support website. Any Suggestions?

Since you're a newcomer to the Mac, see these:
Switching from Windows to Mac OS X,
Basic Tutorials on using a Mac,
MacFixIt Tutorials,
MacTips, and
Switching to the Mac: The Missing Manual, Leopard Edition.
Additionally, *Texas Mac Man* recommends:
Quick Assist.
Welcome to the Switch To A Mac Guides, and
A guide for switching to a Mac.

Similar Messages

  • Samba 4: users unable to move files from compressed folder to Samba share

    I have recently upgraded Samba 3.6.x from Centos 6.6 to Samba 4.1.12 on Centos 7.The shares were migrated in place. I reset permissions and Windows ACLs according to the Samba 4 Wiki.
    When a user opens a compressed folder (a.k.a. Zip file) on Windows 7, then tries to copy the files into a shared folder on the Samba 4 server using drag & drop, only one to four files is actually copied, and the copy process silently fails. If the user waits about 2 minutes, then they can move all of the files without issues. Also, if the user is able to copy all files, when they try to delete the newly created folder they get an error: Thumbs.db cannot be deleted because it is open in Windows Explorer.
    So, the root of the cause seems to be Windows Explorer locking files for too long. But I don't understand this enough to fix it.
    No errors appear in the...
    This topic first appeared in the Spiceworks Community

    "admiz" should be the account name anyway.
    When you do a Get Info on that in the Finder... what is locked, & Rights say?

  • I am trying to send minutes of a meeting to pc users by clicking on export and choosing the word option.  Recipients are unable to open them saying they came as a ZIP compressed folder.  No idea what that is or how to correct the problem.  Help!

    I am trying to send minutes of a meeting created in Pages to pc users by clicking on export then word.  Recipients are telling me they cannot open the minutes which have come as a ZIP compressed folder.  I have no idea what this is or how to fix the problem.  Help?!

    A pc user can open a .zip file by double clicking it.
    If that does not work, you can convert the document to a .pdf by doing the following.
    With the document active, type commannd + P  (the print command).
    In the next screen, on the bottom left, click on PDF, and in the drop down select Save as pdf...
    You will be asked where the .pdf should be saved - the desktop is the easiest.
    Now when you want to send the minutes, you have them as a .pdf file. Anyone with Adobe Acrobat Reder can open this.

  • File created from ZipOutputStream not opening as Windows Compressed Folder

    I create a file using java.util.ZipOutputStream using JDK 5. I can open the file in WinZip. But when I try to open as "Compress (zipped) Folders" in Windows XP, I just get an empty folder. Is there something I have to do other than creating a ZipEntry for each file? From WinZip, I can look at the files and extract them and everything seems to be fine including the folder structure.
    Thanks.

    Make sure there are no invalid characters in folders or files stored in the zip file.
    Windows does not allow the following characters in folder and file names.
    \ / : * ? " < >
    Check your zip folder structure to see if it contains any of these characters.

  • Zip created through java.util.zip but problem in windows XP compress folder

    Hi friends,
    I am a software developer ,working on java/j2ee.currently i am working in a document management software related to logistics.Here i am facing a problem at the time of open the zip file through windows XP's in built software called "Folder compress".It's creared through java.util.zip.zipoutputstream.but at time of open through xp compress folder software ,it's showing error that "you can't open this file , this file are protected for your computer security" , but when i trying to open it through winzip or winrar, it's not giving any problem.My also specefing the code snippet below :-
    ZipOutputStream zip =  null;
         FileOutputStream fileWriter = null;
              try
                   fileWriter = new FileOutputStream(destZipFile);
                   zip = new ZipOutputStream(fileWriter);
                   //required for XP compress
                   zip.setMethod(ZipOutputStream.DEFLATED);
                zip.setLevel(Deflater.DEFAULT_COMPRESSION); //use default level
              }catch (Exception ex){
                   ex.printStackTrace();
                   System.exit(0);
              addFolderToZip("", srcFolder, zip);
              try
                   zip.flush();
                   zip.close();
                   zip=null;
                   fileWriter.close();
                   fileWriter = null;
              }catch (Exception ex)
                   //ex.printStackTrace();
                   logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Zip folder processing");
              }I desperately looking for a help regarding this issue , if any body have any solution the please send at this forum.
    Thanks,
    Chiranjit

    this file working file for winzip or winrar there is no problem.i am also sending the whole code of that java file that can help you better.
    Program Name:     EdocRetrieveServiceSLBean.java
    Description:     EdocRetrieveService CMP Bean Class
    Classes:          EdocRetrieveServiceSLBean
    Package:          net.mlog.edoc.ejb.entity
    Modification History
    <CR No>          <Date>               <Modified By>               <Comments>
    Version 1.0     2005.12.01          Sutapa   Ray               Create
    /** The sequence of methods to be called.
       ===============================================================================================================================
       1. mlogOriginDocumentAudit(String argActionDetails,int argDocumentId,int argActionId,String argActionByUserId)
       2. mlogDestinationBatchDownload(Vector TREEDATA,String SessionIDVal,String argUserId)
              a) Start DIR --
              private  String DoFolder(String folderNname)
              b) Create the folder
              private String CreateFolder(String FolderName,String newFolderPath)
              c) Zip the folder
              private void zipFolder(String srcFolder, String destZipFile)
              d) Add folders to zip file
              private void addToZip(String path, String srcFile, ZipOutputStream zip)
              e) Add the srcFolder to the zip stream.
              private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip)
              f) Delete Directory from server
              public boolean deleteDir(File dir) {
       3. mpsDocumentView(String argUserId,Integer[] argSfxFileId)
       4. mlogOriginDocumentView(int argDocumentId,String argUserId)
       5. findDocTypeForDocId(Integer argDocId) throws RemoteException;
    package net.mlog.edoc.ejb.session;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.ejb.CreateException;
    import javax.ejb.ObjectNotFoundException;
    import javax.ejb.FinderException;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.naming.Context;
    import javax.rmi.PortableRemoteObject;
    import java.rmi.RemoteException;
    //import lib for all entity beans
    import net.mlog.edoc.ejb.entity.IDocumentCMP;
    import net.mlog.edoc.ejb.entity.IDocumentCMPHome;
    import net.mlog.edoc.ejb.entity.IDocumentTypeCMP;
    import net.mlog.edoc.ejb.entity.IDocumentTypeCMPHome;
    import net.mlog.edoc.ejb.entity.IDocumentAuditCMP;
    import net.mlog.edoc.ejb.entity.IDocumentAuditCMPHome;
    //import lib for reader class of properties file
    import net.mlog.edoc.ejb.session.PropertiesFileReader;
    //import lib for user Define File class
    import net.mlog.edoc.ejb.Session.EFile;
    //import lib for SFXWebClient
    import net.mlog.edoc.webservice.sfxWeb.ISFXWebClientSLHome;
    import net.mlog.edoc.webservice.sfxWeb.ISFXWebClientSL;
    import java.sql.Date;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import java.util.zip.Deflater;
    import java.util.Vector;
    import java.util.Iterator;
    import java.util.Collection;
    import java.util.StringTokenizer;
    import java.util.Enumeration;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.File;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    //import lib for NGP Mail
    import javax.jms.Queue;
    import javax.jms.QueueConnectionFactory;
    import javax.jms.QueueConnection;
    import javax.jms.QueueSender;
    import javax.jms.QueueSession;
    import javax.jms.JMSException;
    import weblogic.jms.extensions.WLQueueSession;
    import weblogic.jms.extensions.XMLMessage;
    //import javax.mail.*;
    //import javax.mail.internet.*;
    //import lib for USI
    import com.msl.security.USIException;
    import com.msl.security.USIServerAPI;
    import com.msl.security.UserPolicyData;
    import net.msl.util.logging.MLogger;
    public class EdocRetrieveServiceSLBean implements SessionBean {
      private static final boolean VERBOSE = true;
      private SessionContext ctx;
      public void ejbActivate() {
      public void ejbRemove() {
      public void ejbPassivate() {
      public void setSessionContext(SessionContext ctx) {
        this.ctx = ctx;
      public void ejbCreate () throws CreateException {
      private static final MLogger logger;
      static
         logger = MLogger.getLogger(net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.class.getName(), "net/mlog/edoc/ejb/session/eDocRetrieveServiceMessagesXML");
    //*********************KEEPING AUDITS OF DOCUMENTS BY MLOG ORIGIN PEOPLE*******************************
    * <b>
    * Used for Auditing the user action.
    * </b>
    * This function is called from various functions of eDocController
    * <p>
    * @param  argActionDetails Gives the details of Action in document audit.
    * @param  argDocumentId gives the Document Id in Document Audit.
    * @param  argActionId Action Id in Document Audit.
    * @param  argActionByUserId User Id of the Docment Audit action.
    * @return Returns a boolean value. 1 for success, 0 for Failure.
    public boolean mlogOriginDocumentAudit(String argActionDetails,int argDocumentId,int argActionId,String argActionByUserId) throws RemoteException
         //NGP/JDK Logging
         boolean flag=false;
    try{
         //getting context of the server
         InitialContext documentAuditCMPInitialContext=getInitialContext();
         Object objDocumentAuditCMPRef=null;
         try{
              objDocumentAuditCMPRef=documentAuditCMPInitialContext.lookup("DocumentAuditCMPBeanJNDI");
         catch(Exception e)
              //NGP/JDK Logging if JNDI Not found
              //logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","DocumentAuditCMPBeanJNDI"});
              logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","DocumentAuditCMPBeanJNDI not found");
         //find the maximum audit id in the Document_Audit table
         //Home interface reference of DocumentAuditCMP EJB
         //IDocumentAuditCMPHome iDocumentAuditCMPHomeRef=(IDocumentAuditCMPHome)PortableRemoteObject.narrow(objDocumentAuditCMPRef,IDocumentAuditCMPHome.class);
         IDocumentAuditCMPHome iDocumentAuditCMPHomeRef=(IDocumentAuditCMPHome)objDocumentAuditCMPRef;
         //Remote interface reference of DocumentAuditCMP EJB
         IDocumentAuditCMP iDocumentAuditCMPCreateRef=iDocumentAuditCMPHomeRef.create(new Timestamp(System.currentTimeMillis()),argActionDetails,argActionByUserId,new Integer(argActionId),new Integer(argDocumentId));
         //set flag to true if Document is audited
         flag=true;
    }//end of try
    catch(Exception expt)
         //logger.finer(expt);
         logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.CreateException","Exception in creating Document Audit record");
      return flag;
    //*********************BATCH DOWNLOAD OF DOCUMENTS BY MLOG ORIGIN PEOPLE*******************************
    * <b>
    * Used for Validating the documents.
    * </b>
    * This function is called from Struts
    * <p>
    * @param  TREEDATA Treeset obtained after search.
    * @param  SessionIDVal gives the Session Value Id.
    * @return Returns a boolean value. 1 for success, 0 for Failure.
    public byte[] mlogDestinationBatchDownload(Vector TREEDATA,String SessionIDVal,String argUserId) throws RemoteException
         //NGP/JDK Logging
         /*FileHandler handler = null;
        Logger logger=null;
         try
           PropertiesFileReader propertiesFileReaderRef=new  PropertiesFileReader();
            String logFile=propertiesFileReaderRef.getProperties("/edoc.properties","EDOC_LOG");
           handler = new FileHandler("eDoc.log",0,1, true);
           logger = Logger.getLogger("ErrorMsg");
           logger.addHandler(handler);
           logger.setLevel(Level.ALL);
        }catch(Exception excp)
             NGP/JDK Logging warning
             logger.log(Level.WARNING, "{0} : Unable to find Resource Bundle File : {1}",new Object[] {"MSG001","ErrorMsg"});
         //Remote interface reference of SFXWebClientSL
         ISFXWebClientSL iSFXWebClientSLRef=null;
         //Home interface reference of SFXWebClientSL
         ISFXWebClientSLHome iSFXWebClientSLHomeRef=null;
         Vector filePath=new Vector();
         byte[] fileContent=null;
         String eDocRoot="";
         String eDocPathMain="";
         String eDocPath="";
         File tempRootFileforDelete = null;
         if (TREEDATA.capacity() != 0 )
              String BLNODirPath="";
              String PONODirPath="";
              String SONODirPath="";
              // added for doc type level--2005.11.27--samar
              String docTypeDirPath="";
              String filepath="";
              try
                 PropertiesFileReader propertiesFileReaderRef=new  PropertiesFileReader();
                 filepath=propertiesFileReaderRef.getProperties("/edoc.properties","TEMP_FILE_DIR");
                 logger.finer("File Path:" +filepath);
              }catch(Exception excp)
                   excp.printStackTrace();
                   logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.IOException","TEMP_FILE_DIR property (edoc.properties) not found");
              eDocRoot=CreateFolder("eDocTemp",filepath+File.separator);
              // added for top level--2005.12.02--samar
              //eDocRoot=CreateFolder("eDocTemp",System.getProperty("user.home")+File.separator);
              //eDocPath=CreateFolder(SessionIDVal,eDocRoot+File.separator);
              Enumeration TREEDATAEn = TREEDATA.elements();               //Setting The Tree Folder
              String   BLNO="";
              String   PONO="";
              String   SONO="";
              String   DNO ="";
              while(TREEDATAEn.hasMoreElements())
                   StringTokenizer st = new StringTokenizer((TREEDATAEn.nextElement()).toString(),"_");
                   while (st.hasMoreTokens()) // Extract All the Fields Of Every Vector Element
                        BLNO = st.nextToken();          // CSBWNO
                        PONO = st.nextToken();         // PONO
                        SONO = st.nextToken();        // SONO
                        DNO = st.nextToken();          // DNO
                        eDocPathMain=CreateFolder(SessionIDVal,eDocRoot+File.separator);
                        eDocPath=CreateFolder("eDoc",eDocPathMain+File.separator);
                        BLNODirPath = CreateFolder(BLNO,eDocPath+File.separator);
                        PONODirPath = CreateFolder(PONO,BLNODirPath+File.separator);
                        SONODirPath = CreateFolder(SONO,PONODirPath+File.separator);
                        // added for doc type level--2005.11.27--samar
                        docTypeDirPath=CreateFolder(findDocTypeForDocId(new Integer(DNO)),SONODirPath+File.separator);
                        File tempRootFile=new File(eDocRoot);
                        tempRootFile.canWrite();
                        filePath.add(tempRootFile.getParent());
                        tempRootFileforDelete = tempRootFile;
                        //File tempeDocPathMainFile=new File(eDocPathMain);
                        //filePath.add(tempeDocPathMainFile.getParent());
                        //2005-12-01::code change for top level directory deletion
                        //File tempFile=new File(eDocPath);//BLNODirPath);
                        //filePath.add(tempFile.getParent());
                        filePath.add(eDocPathMain);
                        filePath.add(eDocPath);
                        filePath.add(BLNODirPath);
                        filePath.add(PONODirPath);
                        filePath.add(SONODirPath);
                        // added for doc type level--2005.11.27--samar
                        filePath.add(docTypeDirPath);
                        /* Access The Data from DataBase Temp Storage with Document Id And Store In This SO Folder */
                        /*Long Raw*/
                        try
                             InitialContext initialContext=new InitialContext();
                             int sfxid=0;
                             /*DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
                             OraclePooledConnection pc = new OraclePooledConnection("jdbc:oracle:thin:hr/hr@essoraclesvr:1521:essorcl","edoc","edoc");
                             Connection con=new DBCon().Connect();//pc.getConnection();
                             PreparedStatement pstm=con.prepareStatement("select SFX_FILE_ID from DOCUMENT where DOCUMENT_ID=?");
                             //getting context of the server
                             InitialContext documentCMPInitialContext=getInitialContext();
                             Object objDocumentCMPRef=null;
                             try{
                                  objDocumentCMPRef=documentCMPInitialContext.lookup("DocumentCMPBeanJNDI");
                             catch(Exception e)
                                   //logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","DocumentCMPBeanJNDI"});
                                   logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","DocumentCMPBeanJNDI not found");
                             //Home interface reference of DocumentCMP EJB
                             //IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)PortableRemoteObject.narrow(objDocumentCMPRef,IDocumentCMPHome.class);
                             IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)objDocumentCMPRef;
                             IDocumentCMP documentCMPRef=null;
                             //Remote interface reference of DocumentCMP EJB
                             try{
                                  documentCMPRef=iDocumentCMPHomeRef.findByPrimaryKey(new Integer(DNO));
                             catch(Exception e)
                                  logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ObjectNotFound","Document Id not found");
                             /*pstm.setInt(1,Integer.parseInt(DNO));
                             ResultSet rs1=pstm.executeQuery();
                             if(rs1.next()){
                             sfxid=rs1.getInt(1);
                             sfxid=documentCMPRef.getSfxFileId().intValue();
                             logger.finer("sfxid==="+sfxid);
                             String strFile=documentCMPRef.getDocumentName().toString();
                             //SFX lookup
                             //InitialContext initialContext=new InitialContext();
                             Object sfxWebClient=null;
                             try{
                                    sfxWebClient=initialContext.lookup("SFXWebClientJNDI");
                             catch(Exception e)
                                  //NGP/JDK logging if JNDI not found
                                  //logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","SFXWebClientJNDI"});
                                  logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","SFXWebClientJNDI not found");
                             iSFXWebClientSLHomeRef=(ISFXWebClientSLHome)PortableRemoteObject.narrow(sfxWebClient,ISFXWebClientSLHome.class);
                             iSFXWebClientSLRef=iSFXWebClientSLHomeRef.create();//SFXWebClient reference creation
                             if(iSFXWebClientSLRef!=null)
                                  //logger.finer("ffffffff---");
                                  int arrSFXFileId[]=new int[1];
                                  arrSFXFileId[0]=sfxid;
                                  Object objEFile[]=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
                                  if(objEFile.length>0)
                                       byte b[]=(byte[])objEFile[1];
                                       String f=strFile.substring(strFile.lastIndexOf(File.separator)+1,strFile.length());
                                       // changed(instead of SONODirPath now docTypeDirPath) for doc type level--2005.11.27--samar
                                       FileOutputStream fout=new FileOutputStream(docTypeDirPath+File.separator + f);
                                       //logger.finer("SONODirPath+File.separator + f---"+SONODirPath+File.separator + f);
                                       filePath.add(docTypeDirPath+File.separator + f);
                                       int j;
                                       for(j=0;j<b.length;j++)
                                            fout.write(b[j]);
                                       fout.close();
                                       //for auditing the document
                                       //logger.finer("Document download audited");
                                       boolean flagAudit=mlogOriginDocumentAudit("Document has been downloaded",Integer.parseInt(DNO),5,argUserId);
                                       //logger.finer("Audit complete"+flagAudit);
                                       if(logger.isFinerLoggable()) {
                                            logger.finer("Audit complete"+flagAudit);
                             //Delete after finish
                             tempRootFile.delete();
                         }catch(Exception e)
                             //e.printStackTrace();
                             logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Folder creation processing");
                        /* End Long Raw     */
                      }// end of while hasMoreTokens
               }// end of while hasMoreElements
         }else{ }
         /* Zip */
          try
              zipFolder(eDocPath+File.separator,eDocPath+".zip");
          }catch(Exception excp)
              ////logger.finer(excp.toString());
              logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Zip processing");
         // send the byte array for the file
         String fileName=eDocPath+".zip";
         try{
                   File file=new File(fileName);
                   InputStream is = new FileInputStream(file);
                   // Get the size of the file
                   long length = file.length();
                   // You cannot create an array using a long type.It needs to be an int type.
                   // Before converting to an int type,check to ensure that file is not larger than Integer.MAX_VALUE.
                   //Kept for future requirement if any
                   if (length > Integer.MAX_VALUE) {
                        // File is too large
                   // Create the byte array to hold the data
                    fileContent = new byte[(int)length];
                   // Read in the bytes
                   int offset = 0;
                   int numRead = 0;
                   while (offset < fileContent.length
                           && (numRead=is.read(fileContent, offset, fileContent.length-offset)) >= 0) {
                        offset += numRead;
                   // Ensure all the bytes have been read in
                   if (offset < fileContent.length) {
                        throw new IOException("Could not completely read file "+file.getName());
                   // Close the input stream and return bytes
                   is.close();
         }catch(Exception e){
          deleteDir(tempRootFileforDelete);
         //trying for deleting folder and zip file
         File file=new File(fileName);
         if(file.exists())
                 file.delete();
                 //logger.finer("File Deleted successfully");
         if(file.exists()){
                 //logger.finer("File Not Deleted ");
         /* File FileToDelete = new File(eDocPath+".zip");
         boolean  DelStatus1 = deleteDir(FileToDelete);
          //logger.finer("Deletion 1:"+DelStatus1 );
          File FolderToDelete = new File(eDocPath);
         boolean  DelStatus2 = deleteDir(FolderToDelete);
          //logger.finer("Deletion 2:"+DelStatus2);
          for(int index=filePath.size()-1;index>=0;index--)
               File delFile=new File(filePath.elementAt(index).toString());
               //logger.finer(delFile.getAbsolutePath());
               if(delFile.exists())
                    //logger.finer("Before delete---123");
                    //logger.finer("File Deleted========>"+delFile.delete());
                    //logger.finer("After delete---123");
                    //logger.finer(delFile.getAbsolutePath()+"-----------"+delFile.exists());
          return fileContent;
    /* ***************************Start DIR *********************/
    private  String DoFolder(String folderNname)
         File f;
         f = new File(folderNname);
         f.mkdir();                                                   // Create The Folder
       //f.deleteOnExit();                                  //R n D to Delete The zip folders only  */
         return(folderNname+File.separator);
    //to create the folder
    private String CreateFolder(String FolderName,String newFolderPath)
              String NewDir ="";
              NewDir=newFolderPath + FolderName;
              newFolderPath=DoFolder(NewDir);
              return(NewDir);
    //To zip the folder
    private void zipFolder(String srcFolder, String destZipFile)
         ZipOutputStream zip =  null;
         FileOutputStream fileWriter = null;
              try
                   fileWriter = new FileOutputStream(destZipFile);
                   zip = new ZipOutputStream(fileWriter);
                   //required for XP compress
                   zip.setMethod(ZipOutputStream.DEFLATED);
                zip.setLevel(Deflater.DEFAULT_COMPRESSION); //use default level
              }catch (Exception ex){
                   ex.printStackTrace();
                   System.exit(0);
              addFolderToZip("", srcFolder, zip);
              try
                   zip.flush();
                   zip.close();
                   zip=null;
                   fileWriter.close();
                   fileWriter = null;
              }catch (Exception ex)
                   //ex.printStackTrace();
                   logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Zip folder processing");
         //     File f2= new File(destZipFile);
    *  Write the content of srcFile in a new ZipEntry, named path+srcFile,of the zip stream
    *  The result is that the srcFile will be in the path folder in the generated archive.
    *  @param path          String, the relative path with the root archive.
    *  @param srcFile     String, the absolute path of the file to add
    *  @param zip          ZipOutputStram, the stream to use to write the given file.
    //the folders are added to zip file
    private void addToZip(String path, String srcFile, ZipOutputStream zip)
         File folder = new File(srcFile);
         //folder.deleteOnExit();
         if (folder.isDirectory()) {
              addFolderToZip(path, srcFile, zip);
         else {
              //Transfer bytes from in to out
              byte[] buf = new byte[1024];
              int len;
              FileInputStream in = null;
              try {
                   in = new FileInputStream(srcFile);
                   // void putNextEntry(ZipEntry e) Begins writing a new ZIP file entry
                   // and positions the stream to the start of the entry data.
                   zip.putNextEntry(new ZipEntry(path +File.separator+ folder.getName()));
                   while ((len = in.read(buf)) > 0)
                        zip.write(buf, 0, len);
              }catch (Exception ex){
                   ex.printStackTrace();
                   logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Adding to Zip Folder");
              }finally{
                   try
                        //2005-12-01::file pointer close
                        in.close();
                   }catch(Exception e){
                        e.printStackTrace();
                        logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Adding to Zip Folder");
         folder.delete(); //we addedd for DELETE
    * add the srcFolder to the zip stream.
    * @param path          String, the relatif path with the root archive.
    * @param srcFile     String, the absolute path of the file to add
    * @param zip          ZipOutputStram, the stream to use to write the given file.
    private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip)
         File folder = new File(srcFolder);
         folder.canWrite();
         //folder.deleteOnExit();
         String fileListe[] = folder.list();
         try
              int i = 0;
              while (true)
              addToZip(path+File.separator+ folder.getName(), srcFolder+File.separator+fileListe, zip);
              i++;
         }catch (Exception ex)
         logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Naming after adding to Zip Folder");
    /* $$$$$$$$$$$$$$$$$           End Zipping               $$$$$$$$$$$$$$$ */
    /****************Start Of Deleting Directory from server***********/
    public boolean deleteDir(File dir) {
         // to see if this directory is actually a symbolic link to a directory,
         // we want to get its canonical path
         //- that is, we follow the link to the file it's actually linked to
         File candir;
         try {
              candir = dir.getCanonicalFile();
         } catch (IOException e) {
              return false;
         // a symbolic link has a different canonical path than its actual path,
         // unless it's a link to itself
         if (!candir.equals(dir.getAbsoluteFile())) {
              //this file is a symbolic link, and there's no reason for us to follow it,
              //because then we might be deleting something outside of the directory we were told to delete
              return false;
         // now we go through all of the files and subdirectories in the directory and delete them one by one
         File[] files = candir.listFiles();
         if (files != null) {
         for (int i = 0; i < files.length; i++) {
              File file = files[i];
              //file read only set false
              //in case this directory is actually a symbolic link, or it's empty,
              //we want to try to delete the link before we try anything
              boolean deleted = file.delete();
              if (!deleted) {
                   // deleting the file failed, so maybe it's a non-empty directory
                   if (file.isDirectory()) deleteDir(file);
                   // otherwise, there's nothing else we can do
         // now that we tried to clear the directory out, we can try to delete it again
         return dir.delete();
    /************End Of Deleting Directory *********************/
    private InitialContext getInitialContext() throws NamingException {
    try {
    return new InitialContext();
    } catch (NamingException ne) {
    //logger.finer("Please make sure that the server is running.");
    throw ne;
    //*****************************WEB SERVICE FILE RETRIEVE IMPLEMENTATION FOR MPS PEOPLE*************************************************
    * <b>
    * Used for Retrieval of a document.
    * </b>
    * This function is called from retrieveDocument function of MPStoEdocWebServiceSLBean.
    * <p>
    * @param argUserId User Id of the user who wants to retrieve the document
    * @param argSfxFileId[] Sfx File Id which gives the reference number of the document(s) in the SFX database.
    * @return Returns a one dimentional Object array containing a series of file name and file content of the retrieved documents.
    public Object[] mpsDocumentView(String argUserId,Integer[] argSfxFileId) throws RemoteException
         //NGP/JDK logging
         logger.finer("mpsDocumentView called--");
         try{
              argUserId=argUserId.toUpperCase();
         catch(Exception e)
              e.printStackTrace();
         logger.finer("mpsDocumentView argSfxFileId[0]--"+argSfxFileId[0]);
         Object[] searchResult=null;
         /*FileHandler handler = null;
    Logger logger=null;
         int finalIndex=0;
         try
    //PropertiesFileReader propertiesFileReaderRef=new PropertiesFileReader();
         //String logFile=propertiesFileReaderRef.getProperties("/edoc.properties","EDOC_LOG");
    //handler = new FileHandler("eDoc.log",0,1, true);
    //logger = Logger.getLogger("ErrorMsg");
    //logger.addHandler(handler);
    //logger.setLevel(Level.ALL);
    }catch(Exception excp)
         //NGP/JDK Logging warning
         //logger.log(Level.WARNING, "{0} : Unable to find Resource Bundle File : {1}",new Object[] {"MSG001","ErrorMsg"});
         logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","PurchaseOrderCMPBeanJNDI not found");
         Object objDocumentFile[]=null;
         ISFXWebClientSLHome iSFXWebClientSLHomeRef=null;
         ISFXWebClientSL iSFXWebClientSLRef=null;
         try{
              //Locating SFX WEB CLIENT SESSION BEAN
              InitialContext initialContext=new InitialContext();
              Object sfxWebClient=null;
              try{
                   sfxWebClient=initialContext.lookup("SFXWebClientJNDI");
              catch(Exception e)
                   //NGP/JDK Logging if JNDI not found
                   //logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","SFXWebClientJNDI"});
                   logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","SFXWebClientJNDI not found");
              iSFXWebClientSLHomeRef=(ISFXWebClientSLHome)PortableRemoteObject.narrow(sfxWebClient,ISFXWebClientSLHome.class);
              //creation of SFX we client
              iSFXWebClientSLRef=iSFXWebClientSLHomeRef.create();
              int arrSFXFileId[]=new int[argSfxFileId.length];
              logger.finer("SFXWebClient created----");
              //holds the sequence of SFX file id in the array
              //EFile file=new EFile();
              //getting context of the server
              InitialContext documentCMPInitialContext=getInitialContext();
         Object objDocumentCMPRef=null;
         int docId=0;
         try{
              objDocumentCMPRef=documentCMPInitialContext.lookup("DocumentCMPBeanJNDI");
         catch(Exception e)
                   //NGP/JDK Logging if JNDI not found
                   //logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","DocumentCMPBeanJNDI"});
                   logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","DocumentCMPBeanJNDI not found");
         //Home interface reference of DocumentCMP EJB
         //IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)PortableRemoteObject.narrow(objDocumentCMPRef,IDocumentCMPHome.class);
              IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)objDocumentCMPRef;
         //find the document id in the Document table from the SFx File Id
              for(int index=0;index<argSfxFileId.length;index++)
                   arrSFXFileId[index]=argSfxFileId[index].intValue();
                   logger.finer("mpsDocumentView arrSFXFileId[index]--"+arrSFXFileId[index]);
         logger.finer("For Document auditing----");
         //Remote interface reference of DocumentCMP EJB
         IDocumentCMP iDocumentCMPRef=iDocumentCMPHomeRef.findDocIdBySfxId(new Integer(arrSFXFileId[index]));
                   docId=iDocumentCMPRef.getDocumentId().intValue();
                   //for document audit
                   try{
                        boolean flagAudit=mlogOriginDocumentAudit("Document is Viewed",docId,5,argUserId);
                   catch(Exception e)
                        //logger.finer("Document cannot be audited----");
                        logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in audit processing");
              //call the retrieveDocument method for the above array of elements
              //Object[] tempObjDocumentFile=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
              //EFile file=new EFile();
              //for(int index=0;index<tempObjDocumentFile.length;index++){
              //     file= (EFile) tempObjDocumentFile[index];
              //     objDocumentFile[finalIndex++]=file.getDocFileName();
              //     objDocumentFile[finalIndex++]=file.getDocFileContent();
              objDocumentFile=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
              //EFile[] efileArray = (EFile[]) = objDocumentFile;
              searchResult = new Object[efileArray.length*2];
              for (int i=0;i<efileArray.length;i=i+2)
                   EFile currentFile = efileArray[i];
                   searchResult[i] = currentFile.getDocFileName();
                   searchResult[i+1] = currentFile.getDocFileContent();
              searchResult=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
         }//end of try
         catch(Exception expt)
              //logger.finer(expt);
              logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in retrieve from SFX");
         //if exception occurs returns null as per initilisation above
         //logger.finer("mpsDocumentView size--"+objDocumentFile.length);
         return searchResult;
    //**************************** FILE RETRIEVE IMPLEMENTATION FOR MLOG PEOPLE*******************************
    * <b>
    * Used for Retrieval of a document.
    * </b>
    * This function is called from struts.
    * <p>
    * @param argDocumentId Documnet Id which gives the ID of the document in the eDoc database..
    * @param argUserId User Id of the user who wants to retrieve the document
    * @return Returns a one dimentional Object array containing a series of file name and file content of the retrieved documents.
    public Object[] mlogOriginDocumentView(int argDocumentId,String argUserId) throws RemoteException
         //NGP/JDK Logging
         logger.finer("mlogOriginDocumentView called--");
         try{
              argUserId=argUserId.toUpperCase();
         catch(Exception e)
              //e.printStackTrace();
              logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in uppercase");
    //logger.finer("mlogOriginDocumentView-- argDocumentId---"+argDocumentId);
         /*FileHandler handler = null;
    Logger logger=null;
         try
    //PropertiesFileReader propertiesFileReaderRef=new PropertiesFileReader();
         //String logFile=propertiesFileReaderRef.getProperties("/edoc.properties","EDOC_LOG");
    //handler = new FileHandler("eDoc.log",0,1, tr

  • Opened a bogus email *.zip file from amazon that put two files in my downloads folder OSX 10.8

    Hi
    Can anyone advise my next steps to take, I accidentally opened a bogus email *.zip file attachment from 'Amazon" It unzipped an put two files in my downloads folder one appeared to be a *.exe file. They were deleted immediately along with the email.
    Now I am terrified that there is something lurking on my system...trojan/ keylogger/ virus..
    I am no expert so can anyone give me help!
    My mac is 8 months old running OSX 10.8 with latest updates.
    Thanks Mick

    Thank you both, you have put my mind at rest.
    Normally I am red hot at intercepting bogus emails, not today it would appear!
    I actually was in the process of deleting it and double clicked the file by complete accident, and in a flash it had opened up and put the files in the folder, I spent the rest of the afternoon panicing and reading all forums blogs etc..
    Actually Thomas I found your blog and took some good tips from it, one of them was to switch java off immediately.
    Thanks again
    Mick

  • I want to compress or zip a photo album in iPhoto to a dvd cd

    i want to compress or zip a photo album in iPhoto to a dvd cd

    Why do you want to zip it? and what exactly is it? If your photos are JPEGs then they are very compressed and zipping is not going to save much if any space - it might increase the size even
    If is is an iPhoto album of photos then open the album in iPhoto and select all - export to a desktop folder (see Exporting From iPhoto for options) and select the folder in the finder and right click - either burn to disk or compress and then burn to disk
    If it is a photo book then
    Before  preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF  - right click on it and either burn to disk or compress and then burn the compressed file to disk
    LN

  • Elements 10 Editor error on File / Open iPhoto Library folder

    We have Installed PSE 10 and properly associated iPhoto to use PSE Editor.  When we open iPhoto, we can click a photo, click on Edit.. and the photo appears for editing within the PSE Editor.  This part is GOOD. 
    Our problem is that we don't use iPhoto, and would prefer to open the Editor directly, click on FILE / OPEN... go to our iPhoto library, double click.. and select photos from that pathway.  Instead, the iPhoto folder does NOT open.. and we get the error:
    "Could not complete your request because of a program error."
    We have reinstalled PSE twice, and the same problem occurs.
    Are we doing something wrong, or does PSE Editor NOT work to open the iPhoto folder?
    Thank you for your help!

    When you have imported you images into iPhoto, they are placed in your Library. The library is a special type of folder, similar to a ZIP or other compressed format. Photoshop Elements is unable to open this compressed directory, which is why you get the error. Basically, you need to get your images out of iPhoto and into a normal folder. You can do this by pulling your iPhoto library into the Organizer (File > Get Photos and Vidoes > From iPhoto).

  • How do I open a compressed file in Firefox?

    I have zip files in my downloads on Firefox but can't open them. These are music files already paid for.
    I just can't figure it out. Can anyone help?
    thanks
    DFAL

    It shouldn't be a problem to open ZIP archives in Windows Explorer with a double-click or via the right-click context menu, just like you would open a normal folder.
    You can find "Open containing folder" and Open in the right-click context menu of an item in the Download Manager (Download button on Navigation Toolbar: Show All Downloads)
    Firefox manages downloads in the Downloads folder in the Library (History > Show All History)
    *Downloads are treated as history items: clearing history removes included download items and vice verse.
    *When downloads are in progress you see an animated download button on the Navigation Toolbar showing an estimate of the remaining time
    *The Download button gets a green highlight once all download are finished to make you aware that new downloads are available.
    *Pause and Resume can be found in the right-click context menu of an item.
    You can display the new Download Manager in a tab by opening the about:downloads page and consider to open this page in a separate window.

  • How to open projects within a zip file?

    Is there any way to use the open project feature to open projects within a zip file loaded onto a LMS?  I have several files loaded in a zip file and I would like to navigate to each one within the zip file itself.  The problem that I see is that it does not know where to look.  Within the zip file, there is a main menu file that is used to branch out to another project file and then the user will go back to the main file to navigate to another.  I know this seems complicated, but I am being asked to see if this is possible.

    A zipped SCORM package is always unzipped on the LMS server after upload.  So you need to look at the file and folder structure of the SCORM after it was unzipped to see how to navigate or link to other elements.
    However, let me just say that what you are trying to do will almost certainly cause you many headaches.  A multi-SCO SCORM package is meant to be comprised of several individual SCO modules that do not usually talk to each other because by definition in the SCORM standard they are supposed to be standalone and not require anything else to play.
    Additionally, a multi-SCO package uploaded to an LMS is intended to allow the LMS to control navigation to individual SCO modules via the TOC links that the LMS creates in its own SCORM player.  Once you start over riding these links and opening up individual SCOs without using the TOC links you run the risk of confusing the LMS as to which SCO is actually playing.  The SCORM API only wants to deal with one SCO at a time.

  • How can I open a local folder using flash builder or AS3?

    I need to open a local folder get the zip file and unzip it.
    I know that i cannot open a folder using flash builder, i did it using air app. now i do not know how do i integrate it with my flex program.
    Please help me with this issue.
    Thanks

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script source="Asset/folder.as" />
    <mx:Button x="10" y="10" label="My Button" width="122" height="31" id="myButton" click="folder()"/>
    <mx:ComboBox x="10" y="49" id="cbobx" dataProvider="{}"  ></mx:ComboBox>
    </mx:Application>
    and .as code is:
    // ActionScript file
    import flash.display.*;
    import flash.events.*;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.net.FileReferenceList;
    import mx.controls.Alert;
    import mx.controls.ComboBox;
    private var fr:FileReferenceList;
    private var cmbobx:ComboBox = new ComboBox();
        private function folder():void
    fr = new FileReferenceList();
    fr.browse([new FileFilter("Zip Files", "*.zip")]);
    fr.addEventListener(Event.SELECT, listZipFiles);
    private function listZipFiles(e:Event):void
    Alert.show("selectHandler: " + fr.fileList.length + " files");
            var fls:Array = new Array();
            var file:FileReference;
            for (var i:uint = 0; i < fr.fileList.length; i++)
                file = FileReference(fr.fileList[i]);
                //Alert.show("File Name: " + fr.fileList[i]);
                Alert.show("File Name: " + file.name);
                fls.push(file);
                cmbobx.selectedItem = fls;
    private function getShpFiles(event:MouseEvent):void

  • Password protect windows 7 compressed folder

    How do I password protect my compressed folder or the files inside my compressed folder? Any sugestions????

    Hi,
    A free third party software,
    7-ZIP can accomplish your goal.
    Note: The third-party product discussed here is manufactured by a company that is independent of Microsoft. We make no warranty, implied or otherwise,
    regarding this product's performance or reliability.
    Regards,
    Arthur Li - MSFT

  • How to Open a Specific Folder in the Finder via Shortcut Key

    I'm sure this has been covered elsewhere, so sorry for not finding it...
    Is it possible to assign a shortcut key to open a specific folder with Automator or AppleScript? There are 4-5 commonly used folders buried 10-11 levels deep on a server and I'd love to have a shortcut key to open those particular folders in the Finder.
    Could you give me some assistance?
    Thanks!

    QuickKeys may work, or you can look on http://www.versiontracker.com or http://www.macupdate.com for other alternatives.
    Another option is to create aliases to those folders and store the aliases in a local folder which you can place on your Dock, the Finder window sidebar or toolbar.

  • Hi when i open my application folder, all the application is shown in trash folder. when i click the application it says this app is in trash first move it out. and when i try to open through finder go it says this file doesn't exist. can some1 plz help?

    hi when i open my application folder, all the application is shown in trash folder. when i click the application it says this app is in trash first move it out. and when i try to open through finder> go it says this file doesn't exist. can some1 plz help? how can i put all my application through application folder?

    Something really odd is going on. In your first screen shot, I noticed that the Applications folder does not have the proper icon displayed in the side bar. Also, in the title bar it lists it as Applications 08-59-29-909.
    Not sure where it's picking up that odd name, unless it's because it's still truly within the Trash folder.
    Try this. In the Finder > Preferences > General > turn on "Always open folders in a new window". (I have a feeling you have the default setting with this off).
    Now, in Finder > Go > move down and open the Applications Folder from there. Now open the folder where you see all your applications that you show in your screen shot, select all, and move them to this true appliactions folder.
    This is what you should properly seeing (but with different apps listed):
    See how the Applications folder has the icon of the letter A shaped with a pencil, ruler & pen.

  • My taskbar crashes when I try to open any documents folder. (Windows Explorer, My Library, Documents, Pictures, Music, Videos, Dropbox folder, Skydrive, every folder!)

    Hello. I don't know if this is the right category for my problem but here it goes.
    Since yesterday, I've been trying to open Windows Explorer folder (which include Documents, Pictures, Videos, Music, Downloads, Computer, Dropbox, Skydrive, etc.) and as a result my taskbar and my background crashes, the folder doesn't open and then my taskbar
    and bg goes back to normal. I searched the problem in other forums but the responses are from last year and this is happening since 29/03/2014 (yesterday) so I don't know if this is a new thing or old. I called my sister because she has this same laptop and
    asked her if this is happening to her also and she said it is so I'm starting to think that W8.1 needs an update. Idk :(. We have a Dell Inspiron 15 and it's brand new ! I ordered mine last month.
    Problem Details:
    Windows Explorer Stopped Working
    Description
    Faulting Application Path: C:\Windows\explorer.exe
    Problem signature
    Problem Event Name: APPCRASH
    Application Name: Explorer.EXE
    Application Version: 6.3.9600.16441
    Application Timestamp: 5265dec8
    Fault Module Name: KERNELBASE.dll
    Fault Module Version: 6.3.9600.16496
    Fault Module Timestamp: 52b3f283
    Exception Code: c06d007e
    Exception Offset: 0000000000005a88
    OS Version: 6.3.9600.2.0.0.768.101
    Locale ID: 1033
    Additional Information 1: 6268
    Additional Information 2: 6268221e00f9b14c7c313c3b93b7b1c8
    Additional Information 3: 7b89
    Additional Information 4: 7b8924d255daf0419ae3ae354fccfe84
    Extra information about the problem
    Bucket ID: 85aa1369beebb4641c7856cb8a4724e2 (85906392470)
    If anyone can help me with this, I will be forever thankful !

    Hi,
    Did you make any change to your system recently? To fix this problem, firstly, you can try to use
    SFC /scannow command to fix it for test.
    If problem persists, just try to boot your system into Safe mode to test if this problem occures. If problem occures, It would be better to use system resotre to revert your system to a former timepoint state.
    To find the reason about this problem, you can use Process Monitor
    to capture Explorer.exe when open folder or library.
    Roger Lu
    TechNet Community Support

Maybe you are looking for

  • Itunes wont connect me with the iphone server to upgrade

    I am getting really ticked about this one. I had this in both tiger and now in Leopard. I cannot connect with the itunes store to access my iphone update. the request times out, and then itunes gives me an error message saying I do not have permissio

  • Cant pay bill help

    ive had a really bad case of customer service from bt i moved house in july 2012 and rung and switched over my phone and broadband and from the day we moved in we have never recieved a paper bill through the post or had a phone call to say if our bil

  • How to fix forgetting previously opened tabs when starting Firefox by clicking on a link in an external application?

    Hello, I have the option Startup: "Show my windows and tabs from last time" enabled. Works fine, except when Firefox starts when I click a link in an external application (typically Thunderbird). Then, the new link gets opened in a new tab, Firefox r

  • Basic Excise duty condition value is not captured in in Excise tab at GR

    Dear Experts i am facing the problem that, Basic excise duty amount is not appearing / captured in Excise tab, Goods Receipt Screen. Please guide me on whether the problem is with Excise master data or excise configuration.

  • URL Session Mapping

    Hi, i want to make a group of JSP pages in a Web App, but assuming that the browser doesn't accept cookies. Is there anyway that i don't have to indicate every link as response.encodeUrl("index.jsp")I've heard something about a <url-session-tracking/