Codota Logo
org.eclipse.jgit.transport.resolver
Code IndexAdd Codota to your IDE (free)

How to use org.eclipse.jgit.transport.resolver

Best Java code snippets using org.eclipse.jgit.transport.resolver (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: gocd/gocd

public void init(FilterConfig config) throws ServletException {
  ConfigRepository configRepository = ContextLoader.getCurrentWebApplicationContext().getBean(ConfigRepository.class);
  FileResolver<HttpServletRequest> resolver = new FileResolver<>();
  resolver.exportRepository("api/config-repository.git", configRepository.getGitRepo());
  setRepositoryResolver(resolver);
  setReceivePackFactory(null);
  super.init(config);
}
origin: org.eclipse.jgit/org.eclipse.jgit

  @Override
  public UploadPack create(Object req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Create a new resolver for the given path.
 *
 * @param basePath
 *            the base path all repositories are rooted under.
 * @param exportAll
 *            if true, exports all repositories, ignoring the check for the
 *            {@code git-daemon-export-ok} files.
 */
public FileResolver(File basePath, boolean exportAll) {
  this();
  exportDirectory(basePath);
  setExportAll(exportAll);
}
origin: org.eclipse.jgit/org.eclipse.jgit

public Repository open(C req, String name)
    throws RepositoryNotFoundException, ServiceNotEnabledException {
  if (isUnreasonableName(name))
    throw new RepositoryNotFoundException(name);
  Repository db = exports.get(nameWithDotGit(name));
  if (db != null) {
    db.incrementOpen();
      if (isExportOk(req, name, db)) {
        throw new ServiceNotEnabledException();
origin: org.eclipse.jgit/org.eclipse.jgit

  @Override
  protected void execute(final DaemonClient dc,
      final Repository db,
      @Nullable Collection<String> extraParameters)
      throws IOException,
      ServiceNotEnabledException,
      ServiceNotAuthorizedException {
    ReceivePack rp = receivePackFactory.create(dc, db);
    InputStream in = dc.getInputStream();
    OutputStream out = dc.getOutputStream();
    rp.receive(in, out, null);
  }
} };
origin: org.eclipse.jgit/org.eclipse.jgit

  @Override
  public void run() {
    try {
      final UploadPack rp = uploadPackFactory.create(req, remote);
      rp.upload(out_r, in_w, null);
    } catch (ServiceNotEnabledException e) {
      // Ignored. Client cannot use this repository.
    } catch (ServiceNotAuthorizedException e) {
      // Ignored. Client cannot use this repository.
    } catch (IOException err) {
      // Client side of the pipes should report the problem.
      err.printStackTrace();
    } catch (RuntimeException err) {
      // Client side will notice we went away, and report.
      err.printStackTrace();
    } finally {
      try {
        out_r.close();
      } catch (IOException e2) {
        // Ignore close failure, we probably crashed above.
      }
      try {
        in_w.close();
      } catch (IOException e2) {
        // Ignore close failure, we probably crashed above.
      }
      remote.close();
    }
  }
};
origin: org.eclipse.jgit/org.eclipse.jgit

  Repository openRepository(DaemonClient client, String name)
      throws ServiceMayNotContinueException {
    // Assume any attempt to use \ was by a Windows client
    // and correct to the more typical / used in Git URIs.
    //
    name = name.replace('\\', '/');

    // git://thishost/path should always be name="/path" here
    //
    if (!name.startsWith("/")) //$NON-NLS-1$
      return null;

    try {
      return repositoryResolver.open(client, name.substring(1));
    } catch (RepositoryNotFoundException e) {
      // null signals it "wasn't found", which is all that is suitable
      // for the remote client to know.
      return null;
    } catch (ServiceNotAuthorizedException e) {
      // null signals it "wasn't found", which is all that is suitable
      // for the remote client to know.
      return null;
    } catch (ServiceNotEnabledException e) {
      // null signals it "wasn't found", which is all that is suitable
      // for the remote client to know.
      return null;
    }
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Add a single repository to the set that is exported by this daemon.
 * <p>
 * The existence (or lack-thereof) of <code>git-daemon-export-ok</code> is
 * ignored by this method. The repository is always published.
 *
 * @param name
 *            name the repository will be published under.
 * @param db
 *            the repository instance.
 */
public void exportRepository(String name, Repository db) {
  exports.put(nameWithDotGit(name), db);
}
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Check if this repository can be served.
 * <p>
 * The default implementation of this method returns true only if either
 * {@link #isExportAll()} is true, or the {@code git-daemon-export-ok} file
 * is present in the repository's directory.
 *
 * @param req
 *            the current HTTP request.
 * @param repositoryName
 *            name of the repository, as present in the URL.
 * @param db
 *            the opened repository instance.
 * @return true if the repository is accessible; false if not.
 * @throws java.io.IOException
 *             the repository could not be accessed, the caller will claim
 *             the repository does not exist.
 */
protected boolean isExportOk(C req, String repositoryName, Repository db)
    throws IOException {
  if (isExportAll())
    return true;
  else if (db.getDirectory() != null)
    return new File(db.getDirectory(), "git-daemon-export-ok").exists(); //$NON-NLS-1$
  else
    return false;
}
origin: org.eclipse.jgit/org.eclipse.jgit

  @Override
  public ReceivePack create(Object req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
origin: berlam/github-bucket

/**
 * Create a new resolver for the given path.
 *
 * @param basePath
 *            the base path all repositories are rooted under.
 * @param exportAll
 *            if true, exports all repositories, ignoring the check for the
 *            {@code git-daemon-export-ok} files.
 */
public FileResolver(File basePath, boolean exportAll) {
  this();
  exportDirectory(basePath);
  setExportAll(exportAll);
}
origin: org.eclipse.jgit/org.eclipse.jgit

@Override
public void run() {
  try {
    final ReceivePack rp = receivePackFactory.create(req, remote);
    rp.receive(out_r, in_w, System.err);
  } catch (ServiceNotEnabledException e) {
origin: org.eclipse.jgit/org.eclipse.jgit

  @Override
  protected void execute(final DaemonClient dc,
      final Repository db,
      @Nullable Collection<String> extraParameters)
      throws IOException,
      ServiceNotEnabledException,
      ServiceNotAuthorizedException {
    UploadPack up = uploadPackFactory.create(dc, db);
    InputStream in = dc.getInputStream();
    OutputStream out = dc.getOutputStream();
    if (extraParameters != null) {
      up.setExtraParameters(extraParameters);
    }
    up.upload(in, out, null);
  }
}, new DaemonService("receive-pack", "receivepack") { //$NON-NLS-1$ //$NON-NLS-2$
origin: sonia.jgit/org.eclipse.jgit

  public ReceivePack create(Object req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
origin: sonia.jgit/org.eclipse.jgit

/**
 * Create a new resolver for the given path.
 *
 * @param basePath
 *            the base path all repositories are rooted under.
 * @param exportAll
 *            if true, exports all repositories, ignoring the check for the
 *            {@code git-daemon-export-ok} files.
 */
public FileResolver(final File basePath, final boolean exportAll) {
  this();
  exportDirectory(basePath);
  setExportAll(exportAll);
}
origin: berlam/github-bucket

  @Override
  public UploadPack create(Object req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
origin: sonia.jgit/org.eclipse.jgit

  public UploadPack create(Object req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
origin: sonia.jgit/org.eclipse.jgit.http.server

  @Override
  public void access(HttpServletRequest req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
origin: berlam/github-bucket

  @Override
  public ReceivePack create(Object req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
origin: com.madgag/org.eclipse.jgit.http.server

  @Override
  public void access(HttpServletRequest req, Repository db)
      throws ServiceNotEnabledException {
    throw new ServiceNotEnabledException();
  }
};
org.eclipse.jgit.transport.resolver

Most used classes

  • FileResolver
    Default resolver serving from the local filesystem.
  • ReceivePackFactory
    Create and configure org.eclipse.jgit.transport.ReceivePack service instance.
  • RepositoryResolver
    Locate a Git org.eclipse.jgit.lib.Repository by name from the URL.
  • ServiceNotEnabledException
    Indicates the request service is not enabled on a repository.
  • UploadPackFactory
    Create and configure org.eclipse.jgit.transport.UploadPack service instance.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now