Here you can find the source of cropFile(File cropper, File file)
Parameter | Description |
---|---|
cropper | the cropper |
file | the file to be cropped |
public static File cropFile(File cropper, File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//www.j a v a 2s . co m * Crop a file * * @param cropper * the cropper * @param file * the file to be cropped * @return the cropped file */ public static File cropFile(File cropper, File file) { if (file.getPath().startsWith(cropper.getPath())) { return new File(file.getPath().replace(cropper.getPath(), "")); } return file; } }