Package javax.tools

Examples of javax.tools.FileObject.openInputStream()


    @Override
    protected Reader getReader( final String path )
        throws IOException
    {
        final FileObject file = environment.getFiler().getResource( StandardLocation.CLASS_OUTPUT, "", path );
        return new InputStreamReader( file.openInputStream(), "UTF-8" );
    }

    @Override
    protected Writer getWriter( final String path )
        throws IOException
View Full Code Here


          "META-INF/additional-spring-configuration-metadata.json");
      if (!"file".equals(manualMetadata.toUri().getScheme())) {
        // We only want local files, not any classpath jars
        return metadata;
      }
      InputStream inputStream = manualMetadata.openInputStream();
      try {
        ConfigurationMetadata merged = new ConfigurationMetadata(metadata);
        try {
          merged.addAll(new JsonMarshaller().read(inputStream));
        }
View Full Code Here

            os.close();

            try {
              fo = processingEnv.getFiler().getResource(StandardLocation.SOURCE_OUTPUT, packageName,
                  fileName + ".js");
              InputStream is = fo.openInputStream();
              is.close();
            } catch (FileNotFoundException e) {
              String subClassCode = generateSubclassCode(modelClass, outputConfig);
              fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT, packageName,
                  fileName + ".js");
View Full Code Here

            os.close();

            try {
              fo = processingEnv.getFiler().getResource(StandardLocation.SOURCE_OUTPUT, packageName,
                  fileName + ".js");
              InputStream is = fo.openInputStream();
              is.close();
            } catch (FileNotFoundException e) {
              String subClassCode = generateSubclassCode(modelClass, outputConfig.isDebug());
              fo = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT, packageName,
                  fileName + ".js");
View Full Code Here

    InputStream ormStream;
    try {
      FileObject fileObject = context.getProcessingEnvironment()
          .getFiler()
          .getResource( StandardLocation.CLASS_OUTPUT, pkg, name );
      ormStream = fileObject.openInputStream();
    }
    catch ( IOException e1 ) {
      // TODO - METAGEN-12
      // unfortunately, the Filer.getResource API seems not to be able to load from /META-INF. One gets a
      // FilerException with the message with "Illegal name /META-INF". This means that we have to revert to
View Full Code Here

    protected InputStream getInputStream(String filename, boolean loadingPersistenceXML) {
        InputStream inputStream = null;
       
        try {
            FileObject fileObject = getFileObject(filename, processingEnv);
            inputStream = fileObject.openInputStream();
        } catch (IOException ioe) {
            // If we can't find the persistence.xml from the class output
            // we'll try from the current directory using regular IO.
            try {
                inputStream = new FileInputStream(filename);
View Full Code Here

    InputStream ormStream;
    try {
      FileObject fileObject = context.getProcessingEnvironment()
          .getFiler()
          .getResource( StandardLocation.CLASS_OUTPUT, pkg, name );
      ormStream = fileObject.openInputStream();
    }
    catch ( IOException e1 ) {
      // TODO - METAGEN-12
      // unfortunately, the Filer.getResource API seems not to be able to load from /META-INF. One gets a
      // FilerException with the message with "Illegal name /META-INF". This means that we have to revert to
View Full Code Here

    InputStream ormStream;
    try {
      FileObject fileObject = context.getProcessingEnvironment()
          .getFiler()
          .getResource( StandardLocation.CLASS_OUTPUT, pkg, name );
      ormStream = fileObject.openInputStream();
    }
    catch ( IOException e1 ) {
      // TODO - METAGEN-12
      // unfortunately, the Filer.getResource API seems not to be able to load from /META-INF. One gets a
      // FilerException with the message with "Illegal name /META-INF". This means that we have to revert to
View Full Code Here

    protected InputStream getInputStream(String filename, boolean loadingPersistenceXML) {
        InputStream inputStream = null;
       
        try {
            FileObject fileObject = getFileObject(filename, processingEnv);
            inputStream = fileObject.openInputStream();
        } catch (IOException ioe) {
            // If we can't find the persistence.xml from the class output
            // we'll try from the current directory using regular IO.
            try {
                inputStream = new FileInputStream(filename);
View Full Code Here

    String name = getRelativeName( resource );
    context.logMessage( Diagnostic.Kind.NOTE, "Reading resource " + resource );
    InputStream ormStream;
    try {
      FileObject fileObject = processingEnv.getFiler().getResource( StandardLocation.CLASS_OUTPUT, pkg, name );
      ormStream = fileObject.openInputStream();
    }
    catch ( IOException e1 ) {
//      processingEnv.getMessager()
//          .printMessage(
//              Diagnostic.Kind.WARNING,
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.