亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fileutils.java

?? openmap java寫的開源數字地圖程序. 用applet實現,可以像google map 那樣放大縮小地圖.
?? JAVA
字號:
// **********************************************************************// // <copyright>// //  BBN Technologies//  10 Moulton Street//  Cambridge, MA 02138//  (617) 873-8000// //  Copyright (C) BBNT Solutions LLC. All rights reserved.// // </copyright>// **********************************************************************// // $Source:// /cvs/distapps/openmap/src/openmap/com/bbn/openmap/util/FileUtils.java,v// $// $RCSfile: FileUtils.java,v $// $Revision: 1.1.2.5 $// $Date: 2005/11/23 20:46:03 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.util;import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.util.zip.CRC32;import java.util.zip.ZipEntry;import java.util.zip.ZipInputStream;import java.util.zip.ZipOutputStream;import javax.swing.JFileChooser;import javax.swing.JOptionPane;import javax.swing.filechooser.FileFilter;import com.bbn.openmap.Environment;public class FileUtils {    public static String getFilePathToSaveFromUser(String title) {        JFileChooser chooser = getChooser(title);        int state = chooser.showSaveDialog(null);        String ret = handleResponse(chooser, state);        return ret;    }    public static String getFilePathToOpenFromUser(String title) {        return getFilePathToOpenFromUser(title, null);    }    public static String getFilePathToOpenFromUser(String title, FileFilter ff) {        JFileChooser chooser = getChooser(title);        if (ff != null) {            chooser.setFileFilter(ff);        }        int state = chooser.showOpenDialog(null);        String ret = handleResponse(chooser, state);        return ret;    }    public static JFileChooser getChooser(String title) {        // setup the file chooser        File startingPoint = new File(Environment.get("lastchosendirectory",                System.getProperty("user.home")));        JFileChooser chooser = new JFileChooser(startingPoint);        chooser.setDialogTitle(title);        return chooser;    }    public static String handleResponse(JFileChooser chooser, int state) {        String ret = null;        try {            // only bother trying to read the file if there is one            // for some reason, the APPROVE_OPTION said it was a            // boolean during compile and didn't work in this next            // statement            if ((state != JFileChooser.CANCEL_OPTION)                    && (state != JFileChooser.ERROR_OPTION)) {                ret = chooser.getSelectedFile().getCanonicalPath();                int dirIndex = ret.lastIndexOf(File.separator);                if (dirIndex >= 0) {                    // store the selected file for later                    Environment.set("lastchosendirectory", ret.substring(0,                            dirIndex));                }            }        } catch (IOException ioe) {            JOptionPane.showMessageDialog(null,                    ioe.getMessage(),                    "Error picking file",                    JOptionPane.ERROR_MESSAGE);            ioe.printStackTrace();        }        return ret;    }    /**     * Copy a file to another location, byte-wise.     *      * @param fromFile the File to copy from.     * @param toFile the File to copy to.     * @param bufSize the byte size of the transfer buffer.     * @throws IOException Thrown if anything goes wrong.     */    public static void copy(File fromFile, File toFile, int bufSize)            throws IOException {        FileInputStream fis = new FileInputStream(fromFile);        FileOutputStream fos = new FileOutputStream(toFile);        if (bufSize <= 0) {            bufSize = 1024;        }        byte[] bytes = new byte[bufSize];        int numRead;        while ((numRead = fis.read(bytes)) > 0) {            fos.write(bytes, 0, numRead);        }        fis.close();        fos.close();    }    /**     * Create a zip file containing the given File.     *      * @param zipFileName The path to the zip file. If it doesn't end     *        in .zip, .zip will be added to it.     * @param toBeZipped The Path of the file/directory to be zipped.     * @throws IOException     * @throws FileNotFoundException     */    public static void saveZipFile(String zipFileName, File toBeZipped)            throws IOException, FileNotFoundException {        try {            if (!zipFileName.endsWith(".zip")) {                zipFileName += ".zip";            }            File zipFile = new File(zipFileName);            if (!zipFile.getParentFile().exists()) {                zipFile.getParentFile().mkdirs();            }            FileOutputStream fos = new FileOutputStream(zipFile);            ZipOutputStream zoStream = new ZipOutputStream(fos);            // zoStream.setMethod(ZipOutputStream.STORED);            writeZipEntry(toBeZipped,                    zoStream,                    toBeZipped.getParent().length() + 1);            zoStream.close();        } catch (SecurityException se) {            Debug.error("Security Exception caught while creating "                    + zipFileName);        }    }    protected static void writeZipEntry(File toBeZipped,                                        ZipOutputStream zoStream,                                        int prefixTrimLength) {        if (toBeZipped.isDirectory()) {            File[] files = toBeZipped.listFiles();            for (int i = 0; i < files.length; i++) {                writeZipEntry(files[i], zoStream, prefixTrimLength);            }        } else {            if (Debug.debugging("zip")) {                Debug.output("FileUtils.writeZipEntry("                        + toBeZipped                        + ", "                        + toBeZipped.getAbsolutePath()                                .substring(prefixTrimLength) + ")");            }            writeZipEntry(toBeZipped,                    zoStream,                    prefixTrimLength < 0 ? toBeZipped.getName()                            : toBeZipped.getAbsolutePath()                                    .substring(prefixTrimLength));        }    }    protected static void writeZipEntry(File fromFile,                                        ZipOutputStream zoStream,                                        String entryName) {        try {            long size = fromFile.length();            ZipEntry zEntry = new ZipEntry(entryName);            zEntry.setSize(size);            zEntry.setCrc(0);// Don't know what it these values are            // right now, but zero works...            zoStream.putNextEntry(zEntry);            FileInputStream fis = new FileInputStream(fromFile);            byte[] bytes = new byte[1024];            int numRead;            CRC32 checksum = new CRC32();            while ((numRead = fis.read(bytes)) > 0) {                zoStream.write(bytes, 0, numRead);                checksum.update(bytes, 0, numRead);            }            zEntry.setCrc(checksum.getValue());            fis.close();            zoStream.closeEntry();        } catch (IOException ioe) {            Debug.error("Error writing zip entry " + entryName);            ioe.printStackTrace();        }    }    /**     * Unpack a zip file.     * @param zipFileName The path name of the zip file to unpack.     * @param toDir the directory to put the unpacked files in.     * @param deleteAfter flag to delete the zip file when complete.     */    public static void openZipFile(String zipFileName, File toDir,                                   boolean deleteAfter) {        if (zipFileName != null) {            try {                InputStream in;                if (!toDir.exists()) {                    toDir.mkdirs();                }                URL zipurl = PropUtils.getResourceOrFileOrURL(zipFileName);                if (zipurl != null) {                    in = new BufferedInputStream(zipurl.openStream());                    if (Debug.debugging("zip")) {                        Debug.output(" unzipping " + zipFileName);                    }                    ZipInputStream zin = new ZipInputStream(in);                    ZipEntry e;                    while ((e = zin.getNextEntry()) != null) {                        if (e.isDirectory()) {                            new File(toDir, e.getName()).mkdirs();                        } else {                            if (Debug.debugging("zip")) {                                Debug.output(" unzipping " + e.getName());                            }                            unzip(zin, new File(toDir, e.getName()));                        }                    }                    zin.close();                    if (deleteAfter) {                        if (Debug.debugging("zip")) {                            Debug.output("unzipping complete, deleting zip file");                        }                        File file = new File(zipurl.getFile());                        if (file.exists()) {                            file.delete();                        }                    } else if (Debug.debugging("zip")) {                        Debug.output("unzipping complete, leaving zip file");                    }                    return;                }            } catch (FileNotFoundException e1) {                e1.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            }        }    }    protected static void unzip(ZipInputStream zin, File f) throws IOException {        final int BUFFER = 2048;        FileOutputStream out = new FileOutputStream(f);        byte[] b = new byte[BUFFER];        int len = 0;        BufferedOutputStream dest = new BufferedOutputStream(out, BUFFER);        while ((len = zin.read(b, 0, BUFFER)) != -1) {            dest.write(b, 0, len);        }        dest.flush();        dest.close();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成a人片亚洲日本久久| 日本高清成人免费播放| 色噜噜夜夜夜综合网| 欧美一区二区三区在线看| 国产精品三级电影| 精品一区二区三区在线观看| 91久久线看在观草草青青| 久久综合色播五月| 日韩专区一卡二卡| 国产精品美女www爽爽爽| 成人午夜免费电影| 精品日韩在线观看| 午夜精品成人在线| 欧美系列在线观看| 国产精品三级久久久久三级| 韩日av一区二区| 欧美日韩aaaaaa| 亚洲久本草在线中文字幕| 天天综合天天综合色| 91麻豆精品视频| 中文字幕不卡在线播放| 国产做a爰片久久毛片| 欧美一区二区三区四区在线观看| 亚洲高清久久久| 色综合久久综合网97色综合| 亚洲国产精品激情在线观看| 国产馆精品极品| 久久亚洲私人国产精品va媚药| 免费观看一级欧美片| 欧美日韩国产小视频在线观看| 亚洲一级二级三级在线免费观看| 91麻豆蜜桃一区二区三区| 18欧美亚洲精品| 色先锋aa成人| 一区二区三区在线观看视频| 91激情五月电影| 亚洲黄色免费电影| 欧美性感一区二区三区| 午夜视频一区二区三区| 欧美日韩精品一二三区| 热久久国产精品| 精品区一区二区| 国产成人aaa| 国产亚洲精品7777| 亚洲www啪成人一区二区麻豆| 欧美在线视频你懂得| 午夜欧美在线一二页| 日韩欧美在线一区二区三区| 久久国产精品区| 久久午夜色播影院免费高清| 成人丝袜高跟foot| 亚洲一区二区av在线| 91精品国产日韩91久久久久久| 蓝色福利精品导航| 国产精品福利一区二区| 欧美日韩一区二区欧美激情| 久久99最新地址| 国产精品久久久久影视| 91色porny在线视频| 天天色综合天天| 欧美xingq一区二区| eeuss鲁一区二区三区| 一区二区三区高清| 欧美成人一区二区三区| 成av人片一区二区| 日本伊人午夜精品| 国产精品对白交换视频| 国产一区二区三区高清播放| 欧美成人video| 成人av网址在线观看| 亚洲国产视频在线| 日本一区二区免费在线观看视频 | 精品国产乱码久久久久久夜甘婷婷| 精品一区二区三区影院在线午夜| 国产精品一区免费视频| 欧美猛男gaygay网站| 国产成人自拍网| 亚洲电影视频在线| 欧美国产欧美亚州国产日韩mv天天看完整 | 亚洲欧美激情在线| 久久综合九色综合欧美98| 欧美影院午夜播放| 懂色av一区二区三区蜜臀| 天天操天天综合网| 亚洲精品视频在线观看网站| 2020国产精品久久精品美国| 欧美日韩国产一区| 91麻豆精品在线观看| 国产精品一区二区三区99| 婷婷丁香久久五月婷婷| 亚洲欧美自拍偷拍| 久久婷婷色综合| 欧美久久久久免费| 色婷婷精品大视频在线蜜桃视频| 国产伦理精品不卡| 日韩精品成人一区二区在线| 亚洲男同性视频| 国产精品嫩草久久久久| 久久综合九色欧美综合狠狠 | 日本美女视频一区二区| 亚洲午夜在线电影| 亚洲综合偷拍欧美一区色| 国产精品丝袜在线| 国产日本亚洲高清| 亚洲精品一区二区在线观看| 欧美tickling网站挠脚心| 欧美日韩aaaaa| 91国在线观看| 91久久一区二区| 欧美在线观看一区| 欧美日韩免费观看一区二区三区| 91视频在线看| 色综合久久天天综合网| 94色蜜桃网一区二区三区| 91亚洲精品久久久蜜桃| 成人激情免费视频| 97久久精品人人澡人人爽| 91亚洲精品久久久蜜桃| 在线观看日韩电影| 精品视频资源站| 337p亚洲精品色噜噜| 欧美大片一区二区三区| 久久久99精品久久| 国产精品美女久久久久久久久久久 | 欧美日韩中文精品| 欧美日韩亚洲不卡| 欧美一级夜夜爽| 久久久久成人黄色影片| 中文字幕乱码日本亚洲一区二区| 国产精品久久久久aaaa| 亚洲欧美一区二区三区极速播放 | 国产日韩欧美综合在线| 中文字幕av一区 二区| 亚洲男人的天堂一区二区| 夜夜嗨av一区二区三区中文字幕| 亚洲精品国产一区二区精华液 | 欧美精品一区二区三区很污很色的| 91麻豆精品国产91久久久久 | 日本不卡一区二区三区| 精品一区二区影视| 国产一区二区网址| 9色porny自拍视频一区二区| 国产成人鲁色资源国产91色综| 99精品国产热久久91蜜凸| 成人国产一区二区三区精品| 日产精品久久久久久久性色| 久久成人免费网站| 国产乱码字幕精品高清av| 国产成人免费视频| 色噜噜狠狠成人中文综合| 欧美性受xxxx| 精品国一区二区三区| 久久久久久黄色| 亚洲精品免费在线观看| 亚洲女与黑人做爰| 日韩经典中文字幕一区| 国产乱人伦精品一区二区在线观看| 国产不卡免费视频| 在线观看亚洲一区| 欧美成人精品高清在线播放| 亚洲品质自拍视频| 日韩av高清在线观看| 99精品一区二区三区| 日韩精品一区二区三区视频播放| 国产日韩欧美一区二区三区乱码| 亚洲国产美国国产综合一区二区 | 午夜精品福利一区二区三区av| 蜜桃视频在线观看一区二区| 一本一本大道香蕉久在线精品| 欧美日韩视频专区在线播放| 一区在线播放视频| 奇米一区二区三区| 91蜜桃在线观看| 国产日韩亚洲欧美综合| 亚洲成人动漫在线观看| 不卡的av在线| 欧美一区二区成人| 亚洲国产综合人成综合网站| 久久99九九99精品| 在线免费观看成人短视频| 国产亲近乱来精品视频| 亚洲小说欧美激情另类| 99久久精品国产观看| 日韩欧美国产电影| 日韩黄色免费电影| a4yy欧美一区二区三区| 精品播放一区二区| 久久电影网站中文字幕| 欧美在线一区二区三区| 国产精品不卡一区二区三区| 久久99久久久欧美国产| 欧美影视一区在线| 亚洲欧美成aⅴ人在线观看| 国产精品一区二区你懂的| 国产亚洲短视频| 国产又黄又大久久| 国产丝袜美腿一区二区三区| 婷婷国产在线综合| 欧美日韩在线电影| 日本三级亚洲精品|