Here you can find the source of deleteFile(Object fileObj)
Parameter | Description |
---|---|
fileObj | a parameter |
public static boolean deleteFile(Object fileObj)
//package com.java2s; /* uDig - User Friendly Desktop Internet GIS client * http://udig.refractions.net/*w ww . j a v a 2s . com*/ * (C) 2012, Refractions Research Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html), and the Refractions BSD * License v1.0 (http://udig.refractions.net/files/bsd3-v10.html). */ import java.io.File; public class Main { /** * Deletes a file from the file system. * * @param fileObj * @return true if successful, otherwise false */ public static boolean deleteFile(Object fileObj) { if (fileObj instanceof File) { return deleteFile((File) fileObj); } return false; } /** * Deletes a file from the file system. * * @param file * @return true if successful, otherwise false */ public static boolean deleteFile(File file) { if (file != null) { if (file.exists()) { return file.delete(); } } return false; } }