private static String encode (Map<String, Object> m) {
try {
Gson gson;
final GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapterFactory(new EnumAdaptorFactory());
builder.registerTypeAdapter(Date.class, new DateAdapter());
builder.registerTypeAdapter(File.class, new FileAdapter());
builder.enableComplexMapKeySerialization();
builder.setPrettyPrinting();
gson = builder.create();