Examples of FileFormat


Examples of com.adidas.dam.marvin.client.query.FileFormat

      System.out.println("Unable to create Marvin client");
      e.printStackTrace();
      System.exit(1);
    }
   
    FileFormat format = FileFormat.TIF;
   
      FileFilter imageFilter = FileFilter.create()
          .withFormat(format)
          .withMaxHeight(1000)
          .withMaxWidth(1000)
View Full Code Here

Examples of com.blackbear.flatworm.FileFormat

     * import a file.
     */
    private void importarArquivo() {
        final ConfigurationReader parser = new ConfigurationReader();
        try {
            final FileFormat fileFormat = parser.loadConfigurationFile( ARQUIVO_XML );
            final InputStream inputStream = new FileInputStream( ARQUIVO_TXT );
            final BufferedReader bufIn = new BufferedReader( new InputStreamReader( inputStream ) );
            MatchedRecord results;
            while ( ( results = fileFormat.getNextRecord( bufIn ) ) != null ) {
                if ( results.getRecordName().equals( "emprheader" ) ) {
                    //System.out.println( results.getBean( "beanheader" ) );
                } else if ( results.getRecordName().equals( "emprdetail" ) ) {
                    //System.out.println( results.getBean( "empregado" ) );
                    //System.out.println( results.getBean( "pessoa" ) );
View Full Code Here

Examples of info.aduna.lang.FileFormat

  public void acceptBoolean()
    throws NoCompatibleMediaType
  {
    if (pool.isPreferredBooleanQueryResultFormatUsed()) {
      FileFormat format = pool.getPreferredBooleanQueryResultFormat();
      method.addRequestHeader(ACCEPT, format.getDefaultMIMEType());
      return;
    }
    // Specify which formats we support using Accept headers
    Set<BooleanQueryResultFormat> booleanFormats = BooleanQueryResultParserRegistry.getInstance().getKeys();
    if (booleanFormats.isEmpty()) {
      throw new NoCompatibleMediaType("No boolean query result parsers have been registered");
    }

    for (BooleanQueryResultFormat format : booleanFormats) {
      // Determine a q-value that reflects the user specified preference
      int qValue = 10;

      TupleQueryResultFormat preferredBQRFormat = pool.getPreferredTupleQueryResultFormat();
      if (preferredBQRFormat != null && !preferredBQRFormat.equals(format)) {
        // Prefer specified format over other formats
        qValue -= 2;
      }

      for (String mimeType : format.getMIMETypes()) {
        String acceptParam = mimeType;

        if (qValue < 10) {
          acceptParam += ";q=0." + qValue;
        }
View Full Code Here

Examples of info.aduna.lang.FileFormat

  public void acceptTupleQueryResult()
    throws NoCompatibleMediaType
  {
    if (pool.isPreferredTupleQueryResultFormatUsed()) {
      FileFormat format = pool.getPreferredTupleQueryResultFormat();
      method.addRequestHeader(ACCEPT, format.getDefaultMIMEType());
      return;
    }
    // Specify which formats we support using Accept headers
    Set<TupleQueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys();
    if (tqrFormats.isEmpty()) {
      throw new NoCompatibleMediaType("No tuple query result parsers have been registered");
    }

    for (TupleQueryResultFormat format : tqrFormats) {
      // Determine a q-value that reflects the user specified preference
      int qValue = 10;

      TupleQueryResultFormat preferredTQRFormat = pool.getPreferredTupleQueryResultFormat();
      if (preferredTQRFormat != null && !preferredTQRFormat.equals(format)) {
        // Prefer specified format over other formats
        qValue -= 2;
      }

      for (String mimeType : format.getMIMETypes()) {
        String acceptParam = mimeType;

        if (qValue < 10) {
          acceptParam += ";q=0." + qValue;
        }
View Full Code Here

Examples of info.aduna.lang.FileFormat

  public void acceptGraphQueryResult()
    throws NoCompatibleMediaType
  {
    if (pool.isPreferredTupleQueryResultFormatUsed()) {
      FileFormat format = pool.getPreferredTupleQueryResultFormat();
      method.addRequestHeader(ACCEPT, format.getDefaultMIMEType());
      return;
    }
    acceptRDF(false);
  }
View Full Code Here

Examples of net.sf.graphiti.model.FileFormat

   *            The {@link OutputStream} to write to.
   */
  public void write(String path, OutputStream byteStream) {
    Element element = null;
    Configuration configuration = graph.getConfiguration();
    FileFormat format = configuration.getFileFormat();

    List<Transformation> transformations = format
        .getExportTransformations();
    try {
      for (Transformation transformation : transformations) {
        if (transformation.isXslt()) {
          if (element == null) {
            // writes graph
            element = writeGraph();
          }
         
          XsltTransformer transformer = new XsltTransformer(
              configuration.getContributorId(),
              transformation.getFileName());
          transformer.setParameter("path", path);
          element = transformer.transformDomToDom(element);
        } else {
          transformation.getInstance().transform(graph, byteStream);
          return;
        }
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    if (format.getContentType().equals("text")) {
      String content = element.getTextContent();
      try {
        byteStream.write(content.getBytes());
      } catch (IOException e) {
        // byte stream is a byte array output stream
View Full Code Here

Examples of net.sf.graphiti.model.FileFormat

   * @return A {@link Graph} if successful.
   * @throws Exception
   */
  private Graph parse(Configuration configuration, IFile file)
      throws Exception {
    FileFormat format = configuration.getFileFormat();
    List<Transformation> transformations = format
        .getImportTransformations();
    Element element = null;
    if (transformations.isEmpty()) {
      InputStream in = file.getContents();
      element = DomHelper.parse(in).getDocumentElement();
View Full Code Here

Examples of net.sf.graphiti.model.FileFormat

  public Graph parse(IFile file) throws IncompatibleConfigurationFile {
    // finds all suitable configurations
    String fileExt = file.getFileExtension();
    List<Configuration> configurations = new ArrayList<Configuration>();
    for (Configuration configuration : this.configurations) {
      FileFormat format = configuration.getFileFormat();
      if (format.getFileExtension().equals(fileExt)) {
        configurations.add(configuration);
      }
    }

    Configuration configuration;
View Full Code Here

Examples of net.sf.graphiti.model.FileFormat

      throws CoreException {
    String name = element.getAttribute("name");

    String extension = element.getAttribute("extension");
    String type = element.getAttribute("type");
    FileFormat format = new FileFormat(extension, type);

    IConfigurationElement[] children = element.getChildren("import");
    children = children[0].getChildren();
    parseTransformations(format.getImportTransformations(), children);

    children = element.getChildren("export");
    if (children.length > 0) {
      children = children[0].getChildren();
      parseTransformations(format.getExportTransformations(), children);
    }

    Map<String, ObjectType> graphTypes = parseTypes(element
        .getChildren("graphType"));
    Map<String, ObjectType> vertexTypes = parseTypes(element
View Full Code Here

Examples of net.sourceforge.plantuml.FileFormat

        try {
            XdmNode doc = source.read();
            String text = doc.getStringValue();
            SourceStringReader reader = new SourceStringReader(text);

            FileFormat fmt = "svg".equals(format) ? FileFormat.SVG : FileFormat.PNG;

            String desc = reader.generateImage(baos, new FileFormatOption(fmt));
            if (desc == null) {
                throw new XProcException("PlantUML diagram returned null");
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.