package org.embulk.input;

import java.io.PrintWriter;

public class MetadataUtils
{
    public static final String METADATA_FILE_NAME = "/.metadata_file";

    public void saveMetadata(String metadata)
    {
	try
        {
	    String directory = System.getProperty("user.dir");
	    String metadata_file = directory.concat(METADATA_FILE_NAME);
	    PrintWriter writer = new PrintWriter(metadata_file, "UTF-8");
	    writer.println(metadata);
	    writer.close();
        }
        catch (Exception e)
        {
            System.out.println("[ERROR] Could not store metadata: " + metadata);
        }
    }
}
