Examples of appendContents()


Examples of org.eclipse.core.resources.IFile.appendContents()

    IFile target = _modulePage.getTargetFile();
        String header = Plugin.getDefault().getHeaderFileMap().get(_fileExtToHeader.get(target.getFileExtension())).getHeaderForProject(target.getProject());  
    if (_modulePage.getCopyFromFile() != null) {
      try {
        target.create(new ByteArrayInputStream((header + "\n").getBytes()), true, new NullProgressMonitor());
        target.appendContents(Plugin.getDefault().getResourceAsStream(_modulePage.getCopyFromFile()), true, false, new NullProgressMonitor());     
      } catch (CoreException e) {
        Plugin.getDefault().logError("Unable to create file " + target.getLocation(), e);
        return false;
      } catch (IOException e) {
        Plugin.getDefault().logError("Unable to cpoy from template in file " + target.getLocation(), e);
View Full Code Here

Examples of org.eclipse.core.resources.IFile.appendContents()

      if (!file.exists()) {
        final InputStream ins = new ByteArrayInputStream(key.getBytes());
        file.create(ins, true, null);
      } else {
        final InputStream ins = new ByteArrayInputStream(("\n" + key).getBytes());
        file.appendContents(ins, IFile.FORCE | IFile.KEEP_HISTORY, null);
      }
    } catch (final CoreException e) {
    }
    return file;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFile.appendContents()

          Constants.GITIGNORE_FILENAME));
      entry = getEntry(gitignore.getLocation().toFile(), entry);
      IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
      ByteArrayInputStream entryBytes = asStream(entry);
      if (gitignore.exists())
        gitignore.appendContents(entryBytes, true, true, subMonitor);
      else
        gitignore.create(entryBytes, true, subMonitor);
    }
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFile.appendContents()

        writing = true;
        StringBufferInputStream inputStream = new StringBufferInputStream(content);
        if ( ! file.exists()) {
          file.create(inputStream, false, null);
        } else {
          file.appendContents(inputStream, false, false, null);
        }
      } catch (Exception e) {
      } finally {
        writing = false;
      }
View Full Code Here

Examples of org.platformlayer.auth.crypto.SecretStore.appendContents()

      try {
        SecretStore store = new SecretStore(project.secretData);
        Writer writer = store.buildWriter();
        writer.writeAsymetricUserKey(projectSecretData, user.id, userPublicKey);
        writer.close();
        store.appendContents(writer);

        newSecretData = store.getEncoded();
      } catch (IOException e) {
        throw new RepositoryException("Error writing secrets", e);
      }
View Full Code Here

Examples of org.platformlayer.auth.crypto.SecretStore.appendContents()

      try {
        SecretStore store = new SecretStore(onProject.secretData);
        Writer writer = store.buildWriter();
        writer.writeAsymetricProjectKey(projectSecretData, grantToProject.id, grantToProjectPublicKey);
        writer.close();
        store.appendContents(writer);

        newSecretData = store.getEncoded();
      } catch (IOException e) {
        throw new RepositoryException("Error writing secrets", e);
      }
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.