/*******************************************************************************
 *  Copyright 2017-2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.services.mediastorageapplicationprofile.testcases.filesetcreator;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import cdac.medinfo.sdk.dcm30_04.enums.EnumLoggingLevel;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidDICOMFileException;
import cdac.medinfo.sdk.dcm30_04.services.generalpurposecompressioninterchangeprofiles.MediaStorageCompress_FSC;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
import cdac.medinfo.sdk.dcm30_04.utils.DicomLogger;
/**
 * This class is implemented to use MediaStorage_Compress_FSC.
 * The Compress_Media_Storage_Test_FSC creates object of MediaStorage_Compress_FSC.
 * It calls Process Method of MediaStorage_Compress_FSC.
 * It demonstrates basic functionality of MediaStorage_Compress_FSC class, Generates Dicom-Dir File Set, Compress this DicomDir File-Set on Media Storage Devices.
 * */
public class CompressMediaStorageTest_FSC
{
	public static void main(String[] args) 

	{
		try
		{
			DicomConfig objDicomConfig = DicomConfig.createInstance();
			//enable logging,specify the path of the directory where log files are created.
			//User can specify any directory in place of 'c:\DCM_Logs'.
			////If no directory is defined by user to create logs then it is created in User Temp DIR.
			objDicomConfig.enableLogging(EnumLoggingLevel.INFO, "C:\\DCM_Logs");
			String strFilePath = null;
			System.out.println("Enter the Dicom File path");
			BufferedReader b_reader = new BufferedReader(new InputStreamReader(System.in));
			strFilePath = b_reader.readLine();
			String strStoragePath1 = null;
			System.out.println("Enter Path to store DICOM-DIR File Set");
			BufferedReader b_reader1 = new BufferedReader(new InputStreamReader(System.in));
			strStoragePath1 = b_reader1.readLine();
			//Creates object of MediaStorage_Compress_FSC.
			//calls process() of MediaStorage_Compress_FSC.
			MediaStorageCompress_FSC objMediaStorage_Compress_FSC = new MediaStorageCompress_FSC();
			objMediaStorage_Compress_FSC.process(strFilePath,strStoragePath1);
		}
		catch(InvalidDICOMFileException e)
		{
			DicomLogger objDicomLogger = DicomLogger.getLogger();
			objDicomLogger.log( "Invalid DICOM File" + e.getMessage());
		}
		catch (Exception e) 
		{
			e.printStackTrace();

		}
	}
}
