Package org.geotools.xml

Examples of org.geotools.xml.Parser$Properties


                + "      <ows:Identifier>result</ows:Identifier>\n"
                + "    </wps:RawDataOutput>\n" + "  </wps:ResponseForm>\n" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(36, fc.size());
       
View Full Code Here


     */
    protected Filter readFilter(ObjectInputStream in) throws IOException, ClassNotFoundException {
        byte[] serializedReadFilter = (byte[]) in.readObject();
        if (serializedReadFilter != null) {
            try {
            Parser p = new Parser(CONFIGURATION);
                return (Filter) p.parse(new ByteArrayInputStream(serializedReadFilter));
            } catch (Exception e) {
                throw (IOException) new IOException("Failed to parse filter").initCause(e);
            }
        } else {
            return null;
View Full Code Here

                + "<ows:Identifier>result</ows:Identifier>"
                + "</wps:RawDataOutput>" + "</wps:ResponseForm>" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(1, fc.size());
        SimpleFeature sf = (SimpleFeature) fc.features().next();
View Full Code Here

        assertEquals(-87.507889, re.getMaxX(), 0.001);
        assertEquals(42.509361, re.getMaxY(), 0.001);
    }
   
    ReferencedEnvelope toEnvelope(String xml) throws Exception {
        Parser p = new Parser(new OWSConfiguration());
        Object parsed = p.parse(new ByteArrayInputStream(xml.getBytes()));
        assertTrue(parsed instanceof BoundingBoxType);
        BoundingBoxType box = (BoundingBoxType) parsed;
       
        ReferencedEnvelope re;
        if(box.getCrs() != null) {
View Full Code Here

        this.configuration = configuration;
    }

    @Override
    public Object decode(InputStream input) throws Exception {
        Parser p = new Parser(configuration);
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(input);
        return decode(fct);
    }
View Full Code Here

    @Override
    public Object decode(Object input) throws Exception {
        // xml parsing will most likely return it as parsed already, but if CDATA is used or if
        // it's a KVP parse it will be a string instead
        if(input instanceof String) {
            Parser p = new Parser(configuration);
            input = p.parse(new StringReader((String) input));
        }
       
        // cast and handle the axis flipping
        FeatureCollectionType fct = (FeatureCollectionType) input;
        SimpleFeatureCollection fc = (SimpleFeatureCollection) fct.getFeature().get( 0 );
View Full Code Here

            }
        };
    }
   
    List<Exception> validateSLD() {
        Parser parser = new Parser(new SLDConfiguration());
        try {
            final String sld = editor.getInput();
            parser.validate( new ByteArrayInputStream(sld.getBytes()) );
        } catch( Exception e ) {
            return Arrays.asList( e );
        }
       
        return parser.getValidationErrors();
    }
View Full Code Here

                + "</wps:RawDataOutput>"
                + "</wps:ResponseForm>" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(1, fc.size());
        SimpleFeature sf = (SimpleFeature) fc.features().next();
View Full Code Here

  }

 
  public static String loadWithNewPattern(S3 s3,RefInteger storage, String path) {
    PageContext pc = ThreadLocalPageContext.get();
    Properties prop=null;
    if(pc!=null){
      prop=pc.getApplicationContext().getS3();
    }
    if(prop==null) prop=new PropertiesImpl();
   
    int defaultLocation = prop.getDefaultLocation();
    storage.setValue(defaultLocation);
    String accessKeyId = prop.getAccessKeyId();
    String secretAccessKey = prop.getSecretAccessKey();
   
    int atIndex=path.indexOf('@');
    int slashIndex=path.indexOf('/');
    if(slashIndex==-1){
      slashIndex=path.length();
      path+="/";
    }
    int index;
   
    // key/id
    if(atIndex!=-1) {
      index=path.indexOf(':');
      if(index!=-1 && index<atIndex) {
        accessKeyId=path.substring(0,index);
        secretAccessKey=path.substring(index+1,atIndex);
        index=secretAccessKey.indexOf(':');
        if(index!=-1) {
          String strStorage=secretAccessKey.substring(index+1).trim().toLowerCase();
          secretAccessKey=secretAccessKey.substring(0,index);
          //print.out("storage:"+strStorage);
          storage.setValue(S3.toIntStorage(strStorage, defaultLocation));
        }
      }
      else accessKeyId=path.substring(0,atIndex);
    }
    path=prettifyPath(path.substring(atIndex+1));
    index=path.indexOf('/');
    s3.setHost(prop.getHost());
    if(index==-1){
      if(path.equalsIgnoreCase(S3Constants.HOST) || path.equalsIgnoreCase(prop.getHost())){
        s3.setHost(path);
        path="/";
      }
    }
    else {
      String host=path.substring(0,index);
      if(host.equalsIgnoreCase(S3Constants.HOST) || host.equalsIgnoreCase(prop.getHost())){
        s3.setHost(host);
        path=path.substring(index);
      }
    }
   
View Full Code Here

    if(ac.isORMEnabled()){
      ORMConfiguration conf = ac.getORMConfiguration();
      if(conf!=null)sct.setEL(KeyConstants._orm, conf.toStruct());
    }
    // s3
    Properties props = ac.getS3();
    if(props!=null) {
      sct.setEL(KeyConstants._s3, props.toStruct());
    }
   
    // datasources
    DataSource[] sources = ac.getDataSources();
    if(!ArrayUtil.isEmpty(sources)){
View Full Code Here

TOP

Related Classes of org.geotools.xml.Parser$Properties

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.