Package javax.tools

Examples of javax.tools.FileObject.openInputStream()


    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


        if (resource == null) {
            return null;
        }

        try {
            InputStream is = resource.openInputStream();
            return loadText(is, true);
        } catch (Exception e) {
            warning("Could not load file");
        }
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
      // 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

        Set<String> allServices = new HashSet<String>();
        try {
          FileObject existingFile = filer.getResource(StandardLocation.CLASS_OUTPUT, "",
              resourceFile);
          log("Looking for existing resource file at " + existingFile.toUri());
          Set<String> oldServices = ServicesFile.readServiceFile(existingFile.openInputStream());
          log("Existing service entries: " + oldServices);
          allServices.addAll(oldServices);
        } catch (IOException e) {
          log("Resource file did not already exist.");
        }
View Full Code Here

      FileObject existingFile = processingEnv.getFiler().getResource(
          StandardLocation.CLASS_OUTPUT, "", CALLBACKS_CONFIG_FILE);
      InputStream inputStream = null;
      if (existingFile != null) {
        try {
          inputStream = existingFile.openInputStream();
        } catch (IOException e) {
        }
      }
      callbacksConfigWriter = new DatastoreCallbacksConfigWriter(inputStream);
      if (inputStream != null) {
View Full Code Here

            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);
View Full Code Here

            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);
View Full Code Here

        String relativeName = "META-INF/services/" + serviceName;
        try
        {

            FileObject existingFile = filer.getResource(StandardLocation.CLASS_OUTPUT, "", relativeName);
            BufferedReader r = new BufferedReader(new InputStreamReader(existingFile.openInputStream(), "UTF-8"));
            String line;
            while((line=r.readLine())!=null)
            {
                if(!line.matches(" *#"))
                {
View Full Code Here

    protected InputStream getInputStream(String filename, boolean loadingPersistenceXML) {
        InputStream inputStream = null;
       
        try {
            FileObject fileObject = getFileObject(filename, processingEnv);
            inputStream = fileObject.openInputStream();
        } catch (Exception 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

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.