⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ascendingphoto.java

📁 一个仿造淘宝的jsp网站。功能比较完善
💻 JAVA
字号:
package com.jc.taobao.gjj.logic;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class AscendingPhoto {
    public void IOImage(String clientpath,String servicepath)
    {
        File old = new File(clientpath);
        File newImage = new File(servicepath);
        FileInputStream fis = null;
        FileOutputStream fos = null;

        try {
            if (!old.exists()) {

                return;
            } else {
                fis = new FileInputStream(old);
                
                if(!newImage.exists() ){
                    newImage.createNewFile();
                    
                }
                fos = new FileOutputStream(newImage+"/"+ old.getName());
                
                byte[] temp = new byte[1000];
                int size = fis.read(temp);
                while (size != -1) {
                    fos.write(temp);
                    size = fis.read(temp);
                }
               return ;
            }
        } catch (FileNotFoundException fileNot) {
            fileNot.printStackTrace();
            return;
        } 
        catch(IOException e){
            e.printStackTrace();
            return;
        }
        finally{
            try{
                fis.close();
                fos.close();
                
            }catch(Exception ex){}
            
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -