diff --git a/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msl/MagicNumberMatcher.java b/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msl/MagicNumberMatcher.java index 1e2508a8ab..0e2c8fe875 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msl/MagicNumberMatcher.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msl/MagicNumberMatcher.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2018 Lablicate GmbH. + * Copyright (c) 2016, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -15,17 +15,12 @@ import org.eclipse.chemclipse.converter.core.AbstractMagicNumberMatcher; import org.eclipse.chemclipse.converter.core.IMagicNumberMatcher; -import org.eclipse.chemclipse.msd.converter.supplier.amdis.internal.converter.SpecificationValidatorMSL; public class MagicNumberMatcher extends AbstractMagicNumberMatcher implements IMagicNumberMatcher { @Override public boolean checkFileFormat(File file) { - file = SpecificationValidatorMSL.validateSpecification(file); - if(file.exists()) { - return true; - } - return false; + return checkFileExtension(file, ".MSL"); } } diff --git a/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msp/MagicNumberMatcher.java b/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msp/MagicNumberMatcher.java index f3145261eb..0015a4c24f 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msp/MagicNumberMatcher.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.amdis/src/org/eclipse/chemclipse/msd/converter/supplier/amdis/converter/msp/MagicNumberMatcher.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2018 Lablicate GmbH. + * Copyright (c) 2016, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -15,17 +15,12 @@ import org.eclipse.chemclipse.converter.core.AbstractMagicNumberMatcher; import org.eclipse.chemclipse.converter.core.IMagicNumberMatcher; -import org.eclipse.chemclipse.msd.converter.supplier.amdis.internal.converter.SpecificationValidatorMSP; public class MagicNumberMatcher extends AbstractMagicNumberMatcher implements IMagicNumberMatcher { @Override public boolean checkFileFormat(File file) { - file = SpecificationValidatorMSP.validateSpecification(file); - if(file.exists()) { - return true; - } - return false; + return checkFileExtension(file, ".MSP"); } } diff --git a/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.excel/src/org/eclipse/chemclipse/msd/converter/supplier/excel/converter/MagicNumberMatcher.java b/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.excel/src/org/eclipse/chemclipse/msd/converter/supplier/excel/converter/MagicNumberMatcher.java index 3f70e5e0ac..dffa72b482 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.excel/src/org/eclipse/chemclipse/msd/converter/supplier/excel/converter/MagicNumberMatcher.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.msd.converter.supplier.excel/src/org/eclipse/chemclipse/msd/converter/supplier/excel/converter/MagicNumberMatcher.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2018 Lablicate GmbH. + * Copyright (c) 2016, 2021 Lablicate GmbH. * * All rights reserved. * This program and the accompanying materials are made available under the @@ -15,22 +15,12 @@ import org.eclipse.chemclipse.converter.core.AbstractMagicNumberMatcher; import org.eclipse.chemclipse.converter.core.IMagicNumberMatcher; -import org.eclipse.chemclipse.msd.converter.supplier.excel.internal.converter.SpecificationValidator; public class MagicNumberMatcher extends AbstractMagicNumberMatcher implements IMagicNumberMatcher { @Override public boolean checkFileFormat(File file) { - boolean isValidFormat = false; - try { - file = SpecificationValidator.validateSpecification(file); - if(file.exists()) { - isValidFormat = true; - } - } catch(Exception e) { - // Print no exception. - } - return isValidFormat; + return checkFileExtension(file, ".XLSX"); } } diff --git a/chemclipse/plugins/org.eclipse.chemclipse.xxd.converter.supplier.jcampdx/src/org/eclipse/chemclipse/msd/converter/supplier/jcampdx/io/MagicNumberMatcherChromatogram.java b/chemclipse/plugins/org.eclipse.chemclipse.xxd.converter.supplier.jcampdx/src/org/eclipse/chemclipse/msd/converter/supplier/jcampdx/io/MagicNumberMatcherChromatogram.java index 8393a6f429..a9890a282f 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.xxd.converter.supplier.jcampdx/src/org/eclipse/chemclipse/msd/converter/supplier/jcampdx/io/MagicNumberMatcherChromatogram.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.xxd.converter.supplier.jcampdx/src/org/eclipse/chemclipse/msd/converter/supplier/jcampdx/io/MagicNumberMatcherChromatogram.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2018 Lablicate GmbH. + * Copyright (c) 2016, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -15,27 +15,12 @@ import org.eclipse.chemclipse.converter.core.AbstractMagicNumberMatcher; import org.eclipse.chemclipse.converter.core.IMagicNumberMatcher; -import org.eclipse.chemclipse.xxd.converter.supplier.jcampdx.internal.converter.SpecificationValidator; public class MagicNumberMatcherChromatogram extends AbstractMagicNumberMatcher implements IMagicNumberMatcher { @Override public boolean checkFileFormat(File file) { - boolean isValidFormat = false; - try { - file = SpecificationValidator.validateSpecification(file, "JDX"); - if(file.exists()) { - return true; - } else { - file = SpecificationValidator.validateSpecification(file, "JDL"); - if(file.exists()) { - return true; - } - } - } catch(Exception e) { - // Print no exception. - } - return isValidFormat; + return checkFileExtension(file, ".JDX") || checkFileExtension(file, ".JDL"); } }