@Nullable private Eml readMetadata(String shortname,Archive archive,ActionLogger alog){
  Eml eml;
  File emlFile=archive.getMetadataLocationFile();
  try {
    if (emlFile == null || !emlFile.exists()) {
      emlFile=new File(archive.getLocation(),DataDir.EML_XML_FILENAME);
    }
    if (emlFile.exists()) {
      eml=copyMetadata(shortname,emlFile);
      alog.info("manage.resource.read.eml.metadata");
      return eml;
    }
 else {
      log.warn("Cant find any eml metadata to import");
    }
  }
 catch (  ImportException e) {
    String msg="Cant read basic archive metadata: " + e.getMessage();
    log.warn(msg);
    alog.warn(msg);
    return null;
  }
catch (  Exception e) {
    log.warn("Cant read archive eml metadata",e);
  }
  try {
    eml=convertMetadataToEml(archive.getMetadata());
    alog.info("manage.resource.read.basic.metadata");
    return eml;
  }
 catch (  Exception e) {
    log.warn("Cant read basic archive metadata: " + e.getMessage());
  }
  alog.warn("manage.resource.read.problem");
  return null;
}

@ Nullable private Eml readMetadata ( String shortname , Archive archive , ActionLogger alog ) { Eml eml ; File emlFile = archive . getMetadataLocationFile ( ) ; try { if ( emlFile == null || ! emlFile . exists ( ) ) { emlFile = new File ( archive . getLocation ( ) , DataDir . EML_XML_FILENAME ) ; } if ( emlFile . exists ( ) ) { eml = copyMetadata ( shortname , emlFile ) ; alog . info ( "manage.resource.read.eml.metadata" ) ; return eml ; } else { log . warn ( "Cant find any eml metadata to import" ) ; } } catch ( ImportException e ) { String msg = "Cant read basic archive metadata: " + e . getMessage ( ) ; log . warn ( msg ) ; alog . warn ( msg ) ; return null ; } catch ( Exception e ) { log . warn ( "Cant read archive eml metadata" , e ) ; } try { eml = convertMetadataToEml ( archive . getMetadata ( ) ) ; alog . info ( "manage.resource.read.basic.metadata" ) ; return eml ; } catch ( Exception e ) { log . warn ( "Cant read basic archive metadata: " + e . getMessage ( ) ) ; } alog . warn ( "manage.resource.read.problem" ) ; return null ; }
try to read metadata file for a dwc - archive .
