Package java.io

Examples of java.io.StringBufferInputStream


        String fmodel = dataSrc.getFeatureModel();

        //begin ��ȡ����ģ�������ļ�
        try {
          InputStream inputStream = new StringBufferInputStream(fmodel);
            featureModel = parser.openFmdl(inputStream);

        } catch (Exception exception) {
            errorInfo = "Exception occurs when read feature-model file.\n" + exception;
            return false;
        }
        //end ��ȡ����ģ�������ļ�

        //begin ��ȡԼ��ģ�������ļ�
        try {
           String cm = dataSrc.getConstraintModel();
           InputStream input = new StringBufferInputStream(cm);
            parser.openCmdl(input, featureModel);
        } catch (Exception exception) {
            errorInfo = "Exception occurs when read constraint-model file.\n" + exception;
            return false;
        }
        //end ��ȡԼ��ģ�������ļ�

        //Question: *.im �洢ʲô��Ϣ��im means Interaction-Model
        try{
          String im = dataSrc.getInteractionModel();
          InputStream input =new StringBufferInputStream(im);
            parser.openImdl(input, featureModel);

        } catch (Exception exception) {
            errorInfo = "Exception occurs when read interaction-model file.\n" + exception;
            return false;
        }

        AdaptedStandardStorageFormat reader = new AdaptedStandardStorageFormat();

        //�������viewNameArray.length��draw�ļ�.
        if (viewNameArray.length > 0) {
            //begin ��ȡͼԪ��Ϣ�ļ�
            try {
                drawingArray = new Drawing[viewNameArray.length];
                for (int i = 0; i < viewNameArray.length; i++) {
                    DrawModel draw = dataSrc.getDrawModel(viewNameArray[i]);
                    InputStream input = new StringBufferInputStream(draw.getContent());
                    drawingArray[i] = reader.restore(input);
                    drawingArray[i].setId(draw.getId());
                }

            } catch (Exception exception) {
                errorInfo = "Exception occurs when read project graphic file.\n" + exception;
                return false;
            }
            //end ��ȡͼԪ��Ϣ�ļ�
        } else {
           drawingArray = new Drawing[0];
        }

        //begin ��ȡ������Ϣ
        informationMap = new GroupTreeMap();

        //����൱�����ݱ������������ TODO How to apply in the database environment?
//        Enumeration enumeration = zipFile.entries();
//
//        while (enumeration.hasMoreElements()) {
//            ZipEntry entry = (ZipEntry) enumeration.nextElement();
//
//            String entryName = entry.getName();
//
//            if (entryName.endsWith(".draw")) {
//                int index = entryName.indexOf('\\');
//
//                if (index > 0) {
//                    try {
//                        String id = entryName.substring(0, index);
//                        InputStream inputStream = zipFile.getInputStream(entry);
//                        Drawing drawing = reader.restore(inputStream);
//                        informationMap.add(id, drawing);
//                    } catch (Exception exception) {
//                        errorInfo = "Exception occurs when read information.\n" + exception;
//                        exception.printStackTrace();
//                        return false;
//                    }
//                }
//            }
//        }
        //end ��ȡ������Ϣ

        //begin ��ȡ������Ϣ
        //gh start
        CmdlParser cp = new CmdlParserPrototype();
    try {
      String custom = dataSrc.getCustomizationIndex();
      InputStream inputStream = new StringBufferInputStream(custom);

      for (Iterator<String> itCVId = cp.openCustomizationVersionIds(
          inputStream).iterator(); itCVId.hasNext();) {
        String cvId = itCVId.next();
        String cusVersionFileContent = dataSrc.getCustomizationVersionFileContent(cvId);
        InputStream isCV = new StringBufferInputStream(cusVersionFileContent);
        cp.openCustomizationVersion(isCV , featureModel);
      }
    } catch (Exception exception) {
//      errorInfo = "Exception occurs when read customization file.\n"
//          + exception;
View Full Code Here


      IFolder webInfFolder = warFolder.getFolder("WEB-INF");
      webInfFolder.create(true, true, new SubProgressMonitor(monitor, 1));
      IFolder libFolder = webInfFolder.getFolder("lib");
      libFolder.create(true, true, new SubProgressMonitor(monitor, 1));
      IFile webxml = webInfFolder.getFile("web.xml");
      webxml.create(new StringBufferInputStream(getWebXmlContents()), true, new SubProgressMonitor(monitor, 1));

    } finally {
      monitor.done();
    }
  }
View Full Code Here

      String value = ((String)templateVars.get(aKey)).replaceAll("\\\\", "\\\\\\\\");//$NON-NLS-1$ //$NON-NLS-2$
      contents = contents.replaceAll(aKey, value);
    }
 
    if(output.exists())
      output.setContents(new StringBufferInputStream(contents), true, false, null);
    else
      output.create(new StringBufferInputStream(contents), true, null);
  }
View Full Code Here

      String value = ((String)templateVars.get(aKey)).replaceAll("\\\\", "\\\\\\\\");//$NON-NLS-1$ //$NON-NLS-2$
      contents = contents.replaceAll(aKey, value);
    }
 
    if(output.exists())
      output.setContents(new StringBufferInputStream(contents), true, false, null);
    else
      output.create(new StringBufferInputStream(contents), true, null);
  }
View Full Code Here

      String value = ((String) templateVars.get(aKey)).replaceAll("\\\\", "\\\\\\\\");//$NON-NLS-1$ //$NON-NLS-2$
      contents = contents.replaceAll(aKey, value);
    }

    if (output.exists())
      output.setContents(new StringBufferInputStream(contents), true, false, null);
    else
      output.create(new StringBufferInputStream(contents), true, null);
  }
View Full Code Here

    sb.append("--model fault=levelSensor.fault\n");
       
       
    try
    {
      vdmLinkFile.setContents(new StringBufferInputStream(sb.toString()), true, true, new NullProgressMonitor());
    } catch (CoreException e)
    {
      //DO nothing
    }
   
View Full Code Here

        if (String.class.equals(flavor.getRepresentationClass())) {
          return data;
        } else if (Reader.class.equals(flavor.getRepresentationClass())) {
          return new StringReader(data);
        } else if (InputStream.class.equals(flavor.getRepresentationClass())) {
          return new StringBufferInputStream(data);
        }
        // fall through to unsupported
      } else if (isStringFlavor(flavor)) {
        String data = getPlainData();
        data = (data == null) ? "" : data;
View Full Code Here

    // ---- XMLTestCase methods ----
    private void passXMLTestCaseTest(String xml) throws Exception {
        assertXMLValid(xml);
        assertXMLValid(new InputSource(new StringReader(xml)));
        assertXMLValid(new InputSource(new StringBufferInputStream(xml)));
    }
View Full Code Here

    private void passXMLTestCaseTest(String xml, String systemId, String doctype)
        throws Exception {
        assertXMLValid(xml, systemId, doctype);
        assertXMLValid(new InputSource(new StringReader(xml)), systemId,
                       doctype);
        assertXMLValid(new InputSource(new StringBufferInputStream(xml)),
                       systemId, doctype);
    }
View Full Code Here

            fail("Expected assertion to fail!");
        } catch (AssertionFailedError e) {
            // expecting this
        }
        try {
            assertXMLValid(new InputSource(new StringBufferInputStream(xml)),
                           systemId);
            fail("Expected assertion to fail!");
        } catch (AssertionFailedError e) {
            // expecting this
        }
View Full Code Here

TOP

Related Classes of java.io.StringBufferInputStream

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.