第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

請(qǐng)問(wèn)Java中受密碼保護(hù)的zip文件 問(wèn)問(wèn)題

請(qǐng)問(wèn)Java中受密碼保護(hù)的zip文件 問(wèn)問(wèn)題

慕田峪4524236 2019-11-03 08:04:58
我已經(jīng)使用Java創(chuàng)建了zip文件,如下所示import java.io.*;import java.util.zip.*;public class ZipCreateExample {  public static void main(String[] args) throws IOException {    System.out.print("Please enter file name to zip : ");    BufferedReader input = new BufferedReader        (new InputStreamReader(System.in));    String filesToZip = input.readLine();    File f = new File(filesToZip);    if(!f.exists()) {      System.out.println("File not found.");      System.exit(0);    }    System.out.print("Please enter zip file name : ");    String zipFileName = input.readLine();    if (!zipFileName.endsWith(".zip"))      zipFileName = zipFileName + ".zip";    byte[] buffer = new byte[18024];    try {      ZipOutputStream out = new ZipOutputStream          (new FileOutputStream(zipFileName));      out.setLevel(Deflater.DEFAULT_COMPRESSION);      FileInputStream in = new FileInputStream(filesToZip);      out.putNextEntry(new ZipEntry(filesToZip));      int len;      while ((len = in.read(buffer)) > 0) {        out.write(buffer, 0, len);      }      out.closeEntry();      in.close();      out.close();    } catch (IllegalArgumentException iae) {      iae.printStackTrace();      System.exit(0);    } catch (FileNotFoundException fnfe) {      fnfe.printStackTrace();      System.exit(0);    } catch (IOException ioe) {      ioe.printStackTrace();      System.exit(0);    }  }}現(xiàn)在,當(dāng)我單擊zip文件時(shí),它應(yīng)該提示我輸入密碼,然后解壓縮該zip文件。請(qǐng)任何幫助,我應(yīng)該怎么走?
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 482 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)