/* (non-Javadoc)
@see com.popbill.api.StatementService#deleteFile(java.lang.String, java.number.Integer, java.lang.String, java.lang.String, java.lang.String)
351864
@Override
	public Response deleteFile(String CorpNum, int ItemCode, String MgtKey,
			String FileID, String UserID) throws PopbillException {
		if (MgtKey == null || MgtKey.isEmpty())
			throw new PopbillException(-99999999, "관리번호가 입력되지 않았습니다.");
		if (FileID == null || FileID.isEmpty())
			throw new PopbillException(-99999999, "파일아이디가 입력되지 않았습니다.");
		
		return httppost("/Statement/" + ItemCode + "/" + MgtKey + "/Files/" + FileID,
				CorpNum, null, UserID, "DELETE", Response.class);
		
	}
584407
public static void deleteFile(@NonNull File file) {
    boolean deleted = file.delete();
    if (!deleted) {
      Log.w(LOG_TAG, "Could not delete file: " + file);
    }
  }
1169845
public static void delete( String baseName ,
                               File dataFolder ,
                               boolean force ) throws DataStoreException
    {
    	File[] journalFiles = findJournalFiles(baseName, dataFolder);
    	if (journalFiles.length > 0)
    	{
    		if (force)
        	{
    			for (int i = 0; i < journalFiles.length; i++)
    			{
    	        	if (!journalFiles[i].delete())
    	            	throw new DataStoreException("Cannot delete file : "+journalFiles[i].getAbsolutePath());
    			}  
        	}
    		else
    			throw new DataStoreException("Journal file exist : "+journalFiles[0].getAbsolutePath());
    	}
          	
    	
        File atFile = new File(dataFolder,baseName+AbstractBlockBasedDataStore.ALLOCATION_TABLE_SUFFIX);
        if (atFile.exists())
            if (!atFile.delete())
            	throw new DataStoreException("Cannot delete file : "+atFile.getAbsolutePath());

        File dataFile = new File(dataFolder,baseName+AbstractBlockBasedDataStore.DATA_FILE_SUFFIX);
        if (dataFile.exists())
            if (!dataFile.delete())
            	throw new DataStoreException("Cannot delete file : "+dataFile.getAbsolutePath());
    }
949756
public void delete(String fileName) {
		try {
			synchronized (prepareAnchor(fileName)) {
				// Close file, if it was opened
				IoChannel fileChannel = openFiles.remove(fileName);
				if (fileChannel != null)
					fileChannel.close();

				// Delete the file
				boolean hasDeleted = new File(dbDirectory, fileName).delete();
				if (!hasDeleted && logger.isLoggable(Level.WARNING))
					logger.warning("cannot delete file: " + fileName);
			}
		} catch (IOException e) {
			if (logger.isLoggable(Level.WARNING))
				logger.warning("there is something wrong when deleting " + fileName);
			e.printStackTrace();
		}
	}
829206
public static void deleteFile(File file)
    {
        Check.notNull(file);

        try
        {
            Files.delete(file.toPath());
        }
        catch (final IOException exception)
        {
            throw new LionEngineException(exception, ERROR_DELETE_FILE + file.getAbsolutePath());
        }
    }
1269312
public void delete() throws IOException {
        String idKey = idStrategy().keyFor(id);
        File existingUserFolder = getExistingUserFolder();
        UserIdMapper.getInstance().remove(id);
        AllUsers.remove(id);
        deleteExistingUserFolder(existingUserFolder);
        UserDetailsCache.get().invalidate(idKey);
    }
69652
@Trivial
    private boolean deleteAll(File rootFile) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) {
            Tr.debug(tc, "Delete [ " + rootFile.getAbsolutePath() + " ]");
        }

        if ( FileUtils.fileIsFile(rootFile) ) {
            boolean didDelete = FileUtils.fileDelete(rootFile);
            if ( !didDelete ) {
                Tr.error(tc, "Could not delete file [ " + rootFile.getAbsolutePath() + " ]");
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) {
                    Tr.debug(tc, "Deleted");
                }
            }
            return didDelete;

        } else {
            boolean didDeleteAll = true;
            int deleteCount = 0;

            File childFiles[] = FileUtils.listFiles(rootFile);
            int childCount;
            if ( childFiles != null ) {
                childCount = childFiles.length;
                for ( File childFile : childFiles ) {
                    // Keep iterating even if one of the deletes fails.
                    // Delete as much as possible.
                    if ( !deleteAll(childFile) ) {
                        didDeleteAll = false;
                    } else {
                        deleteCount++;
                    }
                }
            } else {
                childCount = 0;
                deleteCount = 0;
            }

            if ( didDeleteAll ) {
                didDeleteAll = FileUtils.fileDelete(rootFile);
            }
            if ( !didDeleteAll ) {
                Tr.error(tc, "Could not delete directory [ " + rootFile.getAbsolutePath() + " ]");
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) {
                Tr.debug(tc, "Deleted [ " + Integer.valueOf(deleteCount) + " ]" +
                             " of [ " + Integer.valueOf(childCount) + " ]");
            }

            return didDeleteAll;
        }
    }
75203
@Nonnull
  public static FileIOError deleteFileIfExisting (@Nonnull final Path aFile)
  {
    final FileIOError aError = deleteFile (aFile);
    if (aError.getErrorCode ().equals (EFileIOErrorCode.SOURCE_DOES_NOT_EXIST))
      return aError.withoutErrorCode ();
    return aError;
  }
702435
@Override
  public boolean delete(Path path, boolean recursive) throws IOException {
    LOG.debug("delete({}, {})", path, recursive);
    if (mStatistics != null) {
      mStatistics.incrementWriteOps(1);
    }
    AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path));
    DeletePOptions options = DeletePOptions.newBuilder().setRecursive(recursive).build();
    try {
      mFileSystem.delete(uri, options);
      return true;
    } catch (InvalidPathException | FileDoesNotExistException e) {
      LOG.warn("delete failed: {}", e.getMessage());
      return false;
    } catch (AlluxioException e) {
      throw new IOException(e);
    }
  }
279491
public static boolean deleteFileOrDirectory(File file) {
        if (file.exists() && file.isDirectory()) {
            File[] files = file.listFiles();
            if (files != null) {
                for (File f : files) {
                    deleteFileOrDirectory(f);
                }
            }
        }

        return file.delete();
    }
453843
@NotNull
    public static boolean delete(@Nullable File file) {
        if (file == null) {
            LOGGER.warn("cannot delete null File");
            return false;
        }

        final boolean success = org.apache.commons.io.FileUtils.deleteQuietly(file);
        if (!success) {
            LOGGER.debug("Failed to delete file: {}; attempting to delete on exit.", file.getPath());
            file.deleteOnExit();
        }
        return success;
    }
384208
private static void delete(File file) {
    if (file.isDirectory()) {
      File[] files = file.listFiles();
      if (files != null) {
        for (File child : files) {
          delete(child);
        }
      }
    }

    file.delete();
  }
559719
public static boolean deleteFile(File file) {
        if (file.exists()) {
            if (file.isDirectory()) {
                try {
                    deleteDirectory(file);
                    return true;
                } catch (IOException e) {
                    logger.error(e.getMessage());
                    return false;
                }
            } else {
                return file.delete();
            }
        }
        return false;
    }
1308700
@Nonnull
  public static FileIOError deleteFile (@Nonnull final Path aFile)
  {
    ValueEnforcer.notNull (aFile, "Path");

    final Path aRealFile = _getUnifiedPath (aFile);

    if (!aRealFile.toFile ().isFile ())
      return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_FILE, aRealFile);

    // Is the parent directory writable?
    final Path aParentDir = aRealFile.getParent ();
    if (aParentDir != null && !Files.isWritable (aParentDir))
      return EFileIOErrorCode.SOURCE_PARENT_NOT_WRITABLE.getAsIOError (EFileIOOperation.DELETE_FILE, aRealFile);

    return _perform (EFileIOOperation.DELETE_FILE, Files::delete, aRealFile);
  }
1113593
public void deleteFile(String filePath) {
        int retryCount = 1;
        while (retryCount <= deleteFileRetryCount) {
            try {
                if (writer.getFS().exists(new Path(filePath))) {
                    Thread.sleep(1000 * retryCount);
                    writer.getFS().delete(new Path(filePath), false);
                    ++retryCount;
                } else {
                    break;
                }
            } catch (Exception e) {
                log.warn("Exception while deleting the file: " + e.getMessage(), e);
            }
        }
    }
769476
private synchronized static void delete(File file) {
        // Check if file is directory
        if (file.isDirectory()) {
            // Get all files in the folder
            File[] files = file.listFiles();

            // Delete each file in the folder
            for (int i = 0; i < files.length; ++i) {
                delete(files[i]);
            }

            // Delete the folder
            file.delete();
        } else {
            // Delete the file if it is not a folder
            file.delete();
        }
    }
409540
protected void removeFile(String subdir, String filename) throws IOException {
        Path dir = root;
        if (subdir != null) {
            dir = dir.resolve(subdir);
        }
        Files.deleteIfExists(dir.resolve(filename));
    }