Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.BadFormatEx


                    File metadataDir = new File(file, "metadata");

                    File[] xmlFiles = metadataDir.listFiles();

                    if (xmlFiles == null || xmlFiles.length < 1) {
                        throw new BadFormatEx(
                                "Missing XML document in metadata folder " + file.getName() + "/metadata in MEF file "
                                        + mefFile.getName() + ".");
                    }

                    // Handle feature catalog
View Full Code Here


    } finally {
      safeClose(zis);
    }

    if (md == null)
      throw new BadFormatEx("Missing metadata file : " + FILE_METADATA);

    if (info == null)
      throw new BadFormatEx("Missing info file : " + FILE_INFO);

    v.handleMetadata(md, 0);
    v.handleInfo(info, 0);

    return info;
View Full Code Here

                        }
                    }
                }

                if (mdFiles.size() == 0) {
                  throw new BadFormatEx("No valid metadata file found" + ((lastUnknownMetadataFolderName==null)?"":(" in " + lastUnknownMetadataFolderName)) + ".");
                }

                // 1st: Select metadata with schema in info file
                Pair<String,Element> mdInform = mdFiles.get(infoSchema);
                if (mdInform != null) {
View Full Code Here

  public Element handleXml(File xmlFile, IMEFVisitor v) throws Exception {

    Element md;
    md = Xml.loadFile(xmlFile);
    if (md == null)
      throw new BadFormatEx("Missing xml metadata file .");

    v.handleMetadata(md, 0);

    // Generate dummy info file.
    Element info;
View Full Code Here

TOP

Related Classes of org.fao.geonet.exceptions.BadFormatEx

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.