public static void delete(Path file)
	{
		File targetFile = file.toFile();

		// If a bad path is given...
		if(!targetFile.exists())
		{
			logger.warn("Unable to delete " + targetFile.toString() + "  as it does not exist.");
			return;
		}

		// If a folder is given, recursively delete its sub-directories first.
		if(targetFile.isDirectory())
		{
			logger.debug(targetFile.toString() + " is a directory, recursively deleting contents");

			for(File childFile : targetFile.listFiles())
			{
				FileOp.delete(childFile.toPath());
			}
		}

		// Try and delete regular files, logging if unsuccessful
		try
		{
			Files.delete(file);
		}
		catch(NoSuchFileException e)
		{
			logger.info("Could not delete non-existed file: " + file.toString());
		}
		catch(IOException e)
		{
			Errors.nonfatalError("I/O error occurs while deleting file:" + file.toString(), e);
		}

	}