/*******************************************************************************
 *  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.filesetupdater;

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

import cdac.medinfo.sdk.dcm30_04.enums.EnumLoggingLevel;
import cdac.medinfo.sdk.dcm30_04.services.basicmediastorageapplicationprofiles.MediaStorage_FSU;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
/**
 * This class is implemented to use MediaStorage_FSU.
 * The Basic_Media_Storage_Test_FSU creates object of MediaStorage_FSU.
 * It calls Process Method of MediaStorage_FSU.
 * It demonstrates basic functionality of MediaStorage_FSU class, Re-generates or Delete Dicom-Dir File Set from Media Storage Devices.
 * */
public class BasicMediaStorageTest_FSU {
	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");
			System.out.println("Do you want to delete or Rewrite Dicomdir");
			System.out.println("Type D for delete or R for Rewrite");
			BufferedReader b_reader = new BufferedReader(new InputStreamReader(System.in));
			String choice = b_reader.readLine();
			if( choice.equalsIgnoreCase("D")||choice.equalsIgnoreCase("R"))
			{
				System.out.println("Enter the Dicom File set location");
				BufferedReader b_reader1 = new BufferedReader(new InputStreamReader(System.in));
				String strStoragePath = b_reader1.readLine();
				System.out.println("Enter the Dicom File For Rewrite");
				BufferedReader b_reader2 = new BufferedReader(new InputStreamReader(System.in));
				String strFilePath = b_reader2.readLine();
				//Creates object of MediaStorage_FSU class,
				//calls process() of MediaStorage_FSU.
				MediaStorage_FSU objMediaStorage_FSU = new MediaStorage_FSU();
				objMediaStorage_FSU.process(choice, strStoragePath,strFilePath);
			}
			else
			{
				//DicomLogger.getLogger("Invalid Choice");
				System.out.println("invalid choice");
			}
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}
}
