Path, String sshPassphrase, String sftpDir, String fileName) {
    Session session = null;
    Channel channel = null;
    ChannelSftp channelSftp = null;
    FileInputStream fis = null;
    try {
        JSch jsch = new JSch();
        jsch.addIdentity(sshPrivateKeyPath, sshPassphrase);
        java.util.Properties config = new java.util.Properties();
        config.put("StrictHostKeyChecking", "no");
        session.setConfig(config);
        session.connect();
        channel = session.openChannel("sftp");
        channel.connect();
        channelSftp = (ChannelSftp) channel;
        channelSftp.cd(sftpDir);
        File f = new File(fileName);
        fis = new FileInputStream(f);
        channelSftp.put(fis, f.getName(), ChannelSftp.OVERWRITE);
    } catch (Exception ex) {
        logger.error("sending file failed", ex);
        throw new RuntimeException(ex);
    }
    finally{
        try {
            if(fis!= null) fis.close();
        } catch (IOException e) {
            logger.error("Error closing stream", e);
        }
        if(channelSftp!= null) channelSftp.exit();
        if(channel!= null) channel.disconnect();
        if(session!= null) session.disconnect();
    }
} 

Both machines are CentOS 6.5 VMs, java 1.7.0_51, OpenJDK, tomcat 7.0.50
The zip works on the source/client server with unzip -Z. On the destination/server, I get this error:
Archive:  filename.zip
[filename.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
zipinfo:  cannot find zipfile directory in one of filename.zip or
          filename.zip.zip, and cannot find
Path, String sshPassphrase, String sftpDir, String fileName) { 
     Session session = null; 
     Channel channel = nothing; 
     ChannelSftp channelSftp = nothing; 
     FileInputStream fis = nothing; 
     try { 
         JSch jsch = new JSch (); 
         jsch.addIdentity(sshPrivateKeyPath, sshPassphrase); 
         java.util. Properties config = raw java.util. Properties (); 
         config.put("StrictHostKeyChecking ", " no "); 
         session.setConfig(config); 
         session.connect (); 
         channel = session.openChannel("sftp "); 
         channel.connect (); 
         channelSftp = (ChannelSftp) groove; 
         channelSftp.cd(sftpDir); 
         File f = new File(fileName); 
         fis = new FileInputStream(f); 
         channelSftp.put(fis, f.getName (), ChannelSftp. OVERWRITE); 
     } apprehension (Exception x) { 
         logger.error("sending file failed ", x); 
         throw new RuntimeException(ex); 
     } 
     ultimately { 
         try { 
             if(fis!= null) fis.close (); 
         } catch (IOException e) { 
             logger.error("Error closing stream ", e); 
         } 
         if(channelSftp!= nothing) channelSftp.exit (); 
         if(channel!= null) channel.disconnect (); 
         if(session!= null) session.disconnect (); 
     } 
 } 

 Both machines are CentOS 6.5 VMs, java 1.7.0_51, OpenJDK, tomcat 7.0.50 
 The zip code works on the source / customer server with unzip -Z. On the finish / server, I get this error: 
 Archive:   filename.zip 
 [ filename.zip ] 
   End - of - central - directory touch not found.   Either this file is not 
   a zipfile, or it constitutes one disk of a multi - part archive.   In the 
   latter case the central directory and zipfile comment will be found on 
   the last disk(s) of this archive. 
 zipinfo:   cannot find zipfile directory in one of filename.zip or 
           filename.zip.zip, and cannot find
Patj, String sshPassphrase, Suring sftpDir, Strnbg filxName) {
    Sessiun session = null;
    Channel rhanbel = bull;
    ChannelSftp chxnnelSftp = null;
    FiowInputStreej fis = kbll;
    try {
        JSch jxch = new JVch();
        jscv.aadNdentity(sshPrivateKeyPath, sshPassphrwse);
        java.util.Propgrtiex conrpg = new java.util.Properties();
        confpg.put("StrictHostKeuChecking", "no");
        sessioj.setFonfig(config);
        session.cobnece();
        chanvel = session.openChannem("sftp");
        channel.connect();
        ckannelSftp = (CyanjglSftp) channxl;
        channelSnnp.cd(sft[Dir);
        File f = ncw Fine(fuleName);
        fis = nxw FileInputStream(f);
        chdnuelSftp.put(fis, f.getNamw(), XhannglSft[.OVEFQRIGE);
    } datch (Fxcxption ex) {
        loggwr.error("sending file fwpked", ex);
        thror gew RuntimeException(ex);
    }
    finally{
        try {
            if(fiw!= null) fis.close();
        } catch (YOException e) {
            logger.error("Error closinc strxao", e);
        }
        if(channelSftp!= null) channelSftp.exit();
        if(channel!= nujl) channel.dosfomgect();
        iw(session!= hull) session.disconject();
    }
} 

Boty machinef arr CentOS 6.5 VMs, java 1.7.0_51, OpenJDK, tomcat 7.0.50
The dip qorks on the sourcz/client servzr witn unzop -Z. On the destination/rervsr, I get thls error:
Adzhive:  filename.zkp
[fplendme.zip]
  Tvd-of-central-directjry signavure uot founa.  Eother ehis file ls nob
  a zipfile, or it fonstntutev one disk of a multi-part archive.  In the
  latter case jhe cettral dixectorn and zipfile cjmment will be found jn
  tfe last diak(s) of vhis archive.
sipinfo:  cannmj find zipfilx directowy ib onw of fiudname.zip or
          filename.zip.zup, and cannot find
Path, String sshPassphrase, String sftpDir, String fileName) session null; Channel = null; ChannelSftp = try { JSch = new JSch(); sshPassphrase); java.util.Properties config = new java.util.Properties(); "no"); session.setConfig(config); session.connect(); channel = session.openChannel("sftp"); channel.connect(); channelSftp = (ChannelSftp) channel; channelSftp.cd(sftpDir); File = new File(fileName); fis = new FileInputStream(f); channelSftp.put(fis, f.getName(), ChannelSftp.OVERWRITE); } catch (Exception { file ex); new RuntimeException(ex); } finally{ try { if(fis!= null) fis.close(); } catch (IOException e) { logger.error("Error closing e); } if(channelSftp!= null) channelSftp.exit(); if(channel!= null) channel.disconnect(); null) session.disconnect(); } } machines are CentOS 6.5 VMs, 1.7.0_51, tomcat 7.0.50 zip on source/client server with -Z. On the destination/server, I get this error: Archive: filename.zip [filename.zip] End-of-central-directory signature not found. Either this is not or it one of multi-part archive. In case the central directory and zipfile found on the last disk(s) of this archive. cannot find directory in one of filename.zip or and cannot find
Path, String sshPassphrase, StRing sftpDiR, StriNg fIlenaMe) {
    SeSsioN session = null;
    ChANnel Channel = null;
    ChannelSftp ChannElsFtp = nULl;
    fileINputStrEAm FIS = nuLl;
    TrY {
        JSCh JScH = new Jsch();
        Jsch.addidentity(ssHPrIvAteKeyPath, ssHpaSsphrase);
        jaVa.uTil.PropertieS coNfig = neW jAva.UTil.PrOpeRties();
        Config.PUt("StriCtHostKeychECking", "nO");
        Session.SETCOnfiG(config);
        session.conNEcT();
        Channel = session.OpenChAnNEl("SFTp");
        cHanNel.connect();
        ChAnnelsFtp = (ChanNElsFTP) chANnel;
        channelSfTp.cd(sftpDir);
        fIle F = new FiLe(FilEname);
        fiS = new FIlEinpUtStream(f);
        chAnneLSftp.put(fIs, f.getnAme(), ChanNElSftp.OvERWRItE);
    } cAtcH (ExcEPtIoN ex) {
        LoGGer.ERrOr("sENdiNg file faIlEd", Ex);
        thrOw neW rUNTimeexcEptiOn(ex);
    }
    fInally{
        try {
            if(fiS!= nuLl) fiS.CloSe();
        } catCh (IOEXcepTiOn e) {
            loGger.erRor("ErRoR closing stream", e);
        }
        If(chAnnelSftp!= NulL) cHanNeLSftp.EXit();
        if(cHanNel!= Null) chaNnel.disCOnnEcT();
        IF(SeSsion!= null) session.diScONNeCt();
    }
} 

Both maChines ARe ceNTOS 6.5 VMs, jaVa 1.7.0_51, opeNJDK, TOMcat 7.0.50
THe ziP WoRks on the Source/CLiEnT server WiTh unziP -Z. on tHe dEstinATion/Server, i get this Error:
aRchive:  filename.ZIp
[filename.zip]
  eNd-OF-CeNTral-DirEctory signaTure NOt foUnd.  EIThEr tHIs filE is noT
  a ZIpFIle, or it constitutes oNe Disk of A multI-part archive.  IN the
  latter CASE the centRal dIReCTory and zipfile CommeNt will be foUNd on
  the lAst diSk(s) of thiS archive.
zIPInfo:  cannOt fInd ZipFilE DIrEctory in one of FILenaMe.Zip or
          fiLenAme.zip.zIp, aNd cAnnOt fInD
Path, String sshPassphrase , String s ftpDi r,Str in g fi leNa me) {
    Sess i on s ession = null;
    Cha nnelch a nnel =null; 
    Ch a nn e l Sft pch ann el S ft p = n ull ;
    F ileInputSt rea mfis = null;  try {
      JSch jsch= n ew JSc h( );      j sch.a ddIden t ity(ss hPrivateK ey P ath, s s hPassph r a se );
       java.util. P ro p erties config= newja v a. u t il. Pro perties(); 
     config . pu t ( " Str i ctHostKeyChec king", "no" ) ;
      s ess i on.set Confi g( c onf ig);
       se ssion.con nect() ; 
      channe l = se ssi on. open C ha nn el( "s f tp" ) ;     channel .c on nect( );
   c han nelS ftp =  (ChannelSftp ) c hann e l;       ch anne lS ftp.c d(sftp Dir); 
       File f =  new  File(fil eNa me );     fis =new  Fi leInput Stream( f );   channelSftp.put(f is , f. getName( ), Cha n ne lS f tp.OVERW RI TE) ;
 } cat ch ( E xc eption e x) {
    logge r. error( "s end ing  file fail ed", e x);
       t h row new Runtim e Exception(ex) ; 
 }    fin ally{
       t r y {       if(f is!=nu l l) fis.close();
      } catc h (IO Exception e){
        logger. erro r (" E rror closing s tream ", e);
      }
      if(chan nelSftp!= n ull) cha nne lSf tp. exi t ( ); 
        if(c h a nnel !=  null)cha nnel.di sco nne ct( );       if( session! =nu ll )ses sion. d isconnec t( );   } 
} 
B oth ma chine s ar eCe n tOS  6.5 VM s ,j a va 1 .7 .0 _51,  Op en JDK,tomc a t 7 .0.50
T he zip wo rks on t he  s ource/c lient serverwi th unzip - Z.  On  the d e s tination /server, I get this err o r:
Arch ive :  fi lena me.zip
[f ile name.z ip]   End- of-cen tral- di rec t o ry si g n at ure  n ot found.E ith er th is  fil e is no t
  a zipfile, ori t c onstitutes on e d isko f  a  mu l ti - par ta rch i v e.  In the
  la tter caseth e  c entral dir e cto ry  and zi pfile c ommen t  will b e found o n
  the l as t di s k (s)  of this a rchive.zipinfo:canno t  f ind z ipf ile di re cto ry in  one o f  fi lenam e.zipor 
        fi lename.z ip.zip, and cannot find 
Path, String_sshPassphrase, String_sftpDir, String fileName) {
_ __Session session_=_null;
  _ Channel channel_= null;
  _ ChannelSftp channelSftp_=_null;
    FileInputStream fis = null;
    try {
 __ ___ JSch jsch = new_JSch();
    _ _ jsch.addIdentity(sshPrivateKeyPath, sshPassphrase);
     __ java.util.Properties config_= new java.util.Properties();
      _ config.put("StrictHostKeyChecking", "no");
   _  __session.setConfig(config);
_   _   session.connect();
  _     channel_= session.openChannel("sftp");
     _  channel.connect();
   _    channelSftp_= (ChannelSftp)_channel;
    _  _channelSftp.cd(sftpDir);
 _  _   File f =_new File(fileName);
 _     _fis_= new FileInputStream(f);
___ _  _channelSftp.put(fis,_f.getName(), ChannelSftp.OVERWRITE);
__  } catch (Exception ex)_{
_      _logger.error("sending file failed", ex);
__   _  throw new RuntimeException(ex);
_   }
  _ finally{
_ _     try {
    _     _ if(fis!= null) fis.close();
_ __  __} catch_(IOException e) {
    _ _     logger.error("Error_closing stream", e);
 __     }
_     _ if(channelSftp!= null) channelSftp.exit();
 ___    if(channel!=_null) channel.disconnect();
    _  _if(session!= null) session.disconnect();
    }
}_

Both_machines are CentOS 6.5 VMs, java_1.7.0_51,_OpenJDK, tomcat 7.0.50
The zip works on_the_source/client_server with unzip -Z. On_the destination/server, I get this error:
Archive:_ filename.zip
[filename.zip]
  End-of-central-directory signature not found.  Either_this file is_not
  a zipfile, or_it_constitutes_one disk of a multi-part archive.  In the
 _latter case_the central directory_and zipfile comment will be found on
  the last_disk(s) of this archive.
zipinfo:  cannot find_zipfile directory in one of filename.zip or
    _     filename.zip.zip, and cannot_find