package eu.dnetlib.efg1914.commons;

import java.io.IOException;

import javax.xml.bind.JAXBException;

import org.junit.Before;
import org.junit.Test;

import eu.dnetlib.efg1914.commons.store.FTPFilesystemStore;
import eu.dnetlib.efg1914.commons.store.FilesystemStore;
import eu.dnetlib.efg1914.commons.store.MediaStoreException;
import eu.dnetlib.efg1914.commons.store.XMLStoreException;

 

public class StoreTest {
	FilesystemStore st;
	FTPFilesystemStore ftpst;

	@Before
	public void before() throws XMLStoreException, JAXBException, MediaStoreException {
//		BasicConfigurator.configure();
		 st = new FilesystemStore();
//
		 st.setPath("/home/eri/data");
////		ftpst = new FTPFilesystemStore();
////		ftpst.setHost("duffy.di.uoa.gr");
////		ftpst.setUser("eri");
////		ftpst.setPass("pleiades");
////		ftpst.setPath("/home/eri/data");
////		ftpst.init();

	}
//
	@Test
	public void test() throws MediaStoreException, IOException {
//		FileInputStream str = new FileInputStream("C:/Users/Eri/Pictures/Wallpapers/all_together-wallpaper-1920x1080.jpg");
//		BufferedInputStream stream = new BufferedInputStream(str);
//		String id = ftpst.saveFileStream("image/jpg", stream);
//		stream.close();
//		// ftpst.removeFile(id);
//		// ftpst.retrieveBytes(id);
//		// byte[] b =
//		 st.retrieveBytes("b3248d7e-bf14-44a4-b821-2fbed6c5975d.jpg");
//		// st.saveFileBytes("image/jpg", b);
	}

}
