class FileHelper {

	public static String base64EncodeFileName(File file, boolean fullPath) {
		if (!file.exists()) {
			return "";
		} else {
			byte[] input;
			Charset encodeCharset = Charset.defaultCharset();
			
			if (fullPath) {
				input = file.getAbsolutePath().getBytes(encodeCharset);
			} else {
				input = file.getName().getBytes(encodeCharset);
			}
			
			byte[] encodedPath = base64Encode(input);
			return new String(encodedPath, encodeCharset);
		}
	}

}