Package org.eclipse.egit.github.core

Examples of org.eclipse.egit.github.core.TreeEntry


        paths[i] = paths[i].replace('\\', '/');

    boolean createNoJekyll = noJekyll;

    for (String path : paths) {
      TreeEntry entry = new TreeEntry();
      entry.setPath(prefix + path);
      // Only create a .nojekyll file if it doesn't already exist
      if (createNoJekyll && NO_JEKYLL_FILE.equals(entry.getPath()))
        createNoJekyll = false;
      entry.setType(TYPE_BLOB);
      entry.setMode(MODE_BLOB);
      entry.setSha(createBlob(service, repository, outputDirectory, path));
      entries.add(entry);
    }

    if (createNoJekyll) {
      TreeEntry entry = new TreeEntry();
      entry.setPath(NO_JEKYLL_FILE);
      entry.setType(TYPE_BLOB);
      entry.setMode(MODE_BLOB);

      if (isDebug())
        debug("Creating empty .nojekyll blob at root of tree");
      if (!dryRun)
        try {
          entry.setSha(service.createBlob(repository, new Blob()
              .setEncoding(ENCODING_BASE64).setContent("")));
        } catch (IOException e) {
          throw new MojoExecutionException(
              "Error creating .nojekyll empty blob: "
                  + getExceptionMessage(e), e);
View Full Code Here


   
    if (createNoJekyll) {
      if (log.isDebugEnabled()){
        log.debug("Creating empty '.nojekyll' blob at root of tree");
      }
      TreeEntry entry = createEntry("", NO_JEKYLL_FILE, service, repository, outputDirectory);
      entries.add(entry);
    }

    Reference ref = getReference(service, repository);
   
View Full Code Here

  }
 
  private List<TreeEntry> createEntries(List<TreeEntry> entries, final String prefix, final String[] paths,
      final DataService service, final RepositoryId repository, final File outputDirectory) throws GitHubException{
    for (String path : paths) {
      TreeEntry entry = createEntry(prefix, path, service, repository, outputDirectory);
      entries.add(entry);
    }
    return entries;
  }
View Full Code Here

    }
    return ref;
  }

  private TreeEntry createEntry(String prefix, String path, DataService service, RepositoryId repository, File outputDirectory) throws GitHubException {
    TreeEntry entry = new TreeEntry();
    entry.setPath(prefix + path);
    entry.setType(TYPE_BLOB);
    entry.setMode(MODE_BLOB);
    if(!dryRun){
      entry.setSha(createBlob(service, repository, outputDirectory, path));
      log.info("" + path + " -> " + entry.getSha());
    }
    return entry;
  }
View Full Code Here

        paths[i] = paths[i].replace('\\', '/');

    boolean createNoJekyll = noJekyll;

    for (String path : paths) {
      TreeEntry entry = new TreeEntry();
      entry.setPath(prefix + path);
      // Only create a .nojekyll file if it doesn't already exist
      if (createNoJekyll && NO_JEKYLL_FILE.equals(entry.getPath()))
        createNoJekyll = false;
      entry.setType(TYPE_BLOB);
      entry.setMode(MODE_BLOB);
      entry.setSha(createBlob(service, repository, path));
      entries.add(entry);
    }

    if (createNoJekyll) {
      TreeEntry entry = new TreeEntry();
      entry.setPath(NO_JEKYLL_FILE);
      entry.setType(TYPE_BLOB);
      entry.setMode(MODE_BLOB);

      if (isDebug())
        debug("Creating empty .nojekyll blob at root of tree");
      if (!dryRun)
        try {
          entry.setSha(service.createBlob(repository, new Blob()
              .setEncoding(ENCODING_BASE64).setContent("")));
        } catch (IOException e) {
          throw new MojoExecutionException(
              "Error creating .nojekyll empty blob: "
                  + getExceptionMessage(e), e);
View Full Code Here

TOP

Related Classes of org.eclipse.egit.github.core.TreeEntry

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.