Package org.fao.geonet.exceptions

Examples of org.fao.geonet.exceptions.BadParameterEx


                }
                logoDir = this.logoDirectory;
            }

      if (fname.getName().contains("..")) {
        throw new BadParameterEx(
            "Invalid character found in resource name.",
            fname.getName());
      }

      if ("".equals(fname.getName())) {
View Full Code Here


        }

    String file = Util.getParam(params, Params.FNAME);
   
    if (file.contains("..")) {
      throw new BadParameterEx("Invalid character found in resource name.", file);
    }
   
    if ("".equals(file)) {
      throw new Exception("Logo name is not defined.");
    }
View Full Code Here

        }
        String file = Util.getParam(params, Params.FNAME);
        String asFavicon = Util.getParam(params, Params.FAVICON, "0");

        if (file.contains("..")) {
            throw new BadParameterEx(
                    "Invalid character found in resource name.", file);
        }

        if ("".equals(file)) {
            throw new Exception("Logo name is not defined.");
View Full Code Here

            if (Log.isDebugEnabled(Geonet.SEARCH_LOGGER))
                Log.debug(Geonet.SEARCH_LOGGER, "Export Statistics table: no table name received from the client.");
        }

        if (!allowedTablesToExport.contains(tableToExport)) {
            throw new BadParameterEx("tableToExport", tableToExport);
        }

        // file to write
        File tableDumpFile = new File(appPath + File.separator + "images" + File.separator + "statTmp");
        IO.mkdirs(tableDumpFile, "Statistics temp directory");
View Full Code Here

                }
      }
    } else {
                  fname = param.getTextTrim();
      if (fname.contains("..")) {
        throw new BadParameterEx("Invalid character found in thesaurus name.", fname);
      }
     
      rdfFile = new File(uploadDir, fname);
            fname = fname.replaceAll("\\s+", "");
    }
View Full Code Here

    if (access.equals(Params.Access.PUBLIC)) {
      File dir = new File(Lib.resource.getDir(context, access, id));
      String fname = Util.getParam(params, Params.FNAME);

      if (fname.contains("..")) {
        throw new BadParameterEx("Invalid character found in resource name.", fname);
      }
     
      File file = new File(dir, fname);
      return BinaryFile.encode(200, file.getAbsolutePath(),false);
    }
View Full Code Here

        Element processedMetadata;
        try {
            final String siteURL = context.getBean(SettingManager.class).getSiteURL(context);
            processedMetadata = process(id, process, save, _appPath, xslProcessingReport, false, siteURL, request);
            if (processedMetadata == null) {
                throw new BadParameterEx("Processing failed", "Not found:"
                        + xslProcessingReport.getNotFoundMetadataCount() +
                        ", Not owner:" + xslProcessingReport.getNotEditableMetadataCount() +
                        ", No process found:" + xslProcessingReport.getNoProcessFoundCount() + ".");
            }
        } catch (Exception e) {
View Full Code Here

        if (!style.equals("_none_"))
            xml = Xml.transform(xml, stylePath +"/"+ style);

        String schema = dataMan.autodetectSchema(xml);
        if (schema == null)
          throw new BadParameterEx("Can't detect schema for metadata automatically.", "schema is unknown");

    if (validate) DataManager.validateMetadata(schema, xml, context);

    //-----------------------------------------------------------------------
    //--- if the uuid does not exist and is not a template we generate it
View Full Code Here

    {
      String attrset = xmlQuery.getAttributeValue("attrset");
      @SuppressWarnings("unchecked")
            List<Element> children = xmlQuery.getChildren();
      if (children.size() == 0)
        throw new BadParameterEx("Z39.50-query", Xml.getString(xmlQuery));

      Element child = children.get(0);
      return "@attrset " + attrset + " " + newQuery(child);
    }
    else if (name.equals("and") || name.equals("or") || name.equals("not"))
View Full Code Here

    //-----------------------------------------------------------------------
    //--- check access
    int iLocalId = Integer.parseInt(id);

    if (!dataManager.existsMetadata(iLocalId))
      throw new BadParameterEx("id", id);

    if (!accessMan.canEdit(context, id))
        Lib.resource.denyAccess(context);
  }
View Full Code Here

TOP

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

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.