Examples of FileResolver


Examples of org.apache.ivy.util.FileResolver

        this.ivy = ivy;
    }

    public void parse(URL settings) throws ParseException, IOException {
        configurator = new Configurator();
        configurator.setFileResolver(new FileResolver() {
            public File resolveFile(String path, String filename) {
                return Checks.checkAbsolute(path, filename);
            }
        });
        // put every type definition from ivy to configurator
View Full Code Here

Examples of org.eclipse.jgit.http.server.resolver.FileResolver

  public void testNotAGitRepository() throws IOException,
      ServiceNotEnabledException {
    final Repository a = createBareRepository();
    final String name = a.getDirectory().getName() + "-not-a-git";
    final File base = a.getDirectory().getParentFile();
    FileResolver resolver = new FileResolver(base, false);

    try {
      resolver.open(null, name);
    } catch (RepositoryNotFoundException e) {
      assertEquals("repository not found: " + name, e.getMessage());

      Throwable why = e.getCause();
      assertNotNull("has cause", why);
View Full Code Here

Examples of org.eclipse.jgit.http.server.resolver.FileResolver

    super.init(config);

    if (resolver == null) {
      final File root = getFile("base-path");
      final boolean exportAll = getBoolean("export-all");
      setRepositoryResolver(new FileResolver(root, exportAll));
    }

    initialized = true;

    if (uploadPackFactory != UploadPackFactory.DISABLED) {
View Full Code Here

Examples of org.eclipse.jgit.http.server.resolver.FileResolver

      assertUnreasonable("C:/windows");
  }

  private void assertUnreasonable(String name)
      throws ServiceNotEnabledException {
    FileResolver r = new FileResolver(new File("."), false);
    try {
      r.open(null, name);
      fail("Opened unreasonable name \"" + name + "\"");
    } catch (RepositoryNotFoundException e) {
      assertEquals("repository not found: " + name, e.getMessage());
      assertNull("has no cause", e.getCause());
    }
View Full Code Here

Examples of org.eclipse.jgit.http.server.resolver.FileResolver

  public void testExportOk() throws IOException {
    final Repository a = createBareRepository();
    final String name = a.getDirectory().getName();
    final File base = a.getDirectory().getParentFile();
    final File export = new File(a.getDirectory(), "git-daemon-export-ok");
    FileResolver resolver;

    assertFalse("no git-daemon-export-ok", export.exists());
    resolver = new FileResolver(base, false /* require flag */);
    try {
      resolver.open(null, name);
      fail("opened non-exported repository");
    } catch (ServiceNotEnabledException e) {
      assertEquals("Service not enabled", e.getMessage());
    }

    resolver = new FileResolver(base, true /* export all */);
    try {
      resolver.open(null, name).close();
    } catch (ServiceNotEnabledException e) {
      fail("did not honor export-all flag");
    }

    export.createNewFile();
    assertTrue("has git-daemon-export-ok", export.exists());
    resolver = new FileResolver(base, false /* require flag */);
    try {
      resolver.open(null, name).close();
    } catch (ServiceNotEnabledException e) {
      fail("did not honor git-daemon-export-ok");
    }
  }
View Full Code Here

Examples of org.gradle.api.internal.file.FileResolver

    public StartParameter convert(ParsedCommandLine options, StartParameter startParameter) throws CommandLineArgumentException {
        LoggingConfiguration loggingConfiguration = loggingConfigurationCommandLineConverter.convert(options);
        startParameter.setLogLevel(loggingConfiguration.getLogLevel());
        startParameter.setColorOutput(loggingConfiguration.isColorOutput());
        FileResolver resolver = new BaseDirConverter(startParameter.getCurrentDir());

        for (String keyValueExpression : options.option(SYSTEM_PROP).getValues()) {
            String[] elements = keyValueExpression.split("=");
            startParameter.getSystemPropertiesArgs().put(elements[0], elements.length == 1 ? "" : elements[1]);
        }

        for (String keyValueExpression : options.option(PROJECT_PROP).getValues()) {
            String[] elements = keyValueExpression.split("=");
            startParameter.getProjectProperties().put(elements[0], elements.length == 1 ? "" : elements[1]);
        }

        if (options.hasOption(NO_SEARCH_UPWARDS)) {
            startParameter.setSearchUpwards(false);
        }

        if (options.hasOption(PROJECT_DIR)) {
            startParameter.setProjectDir(resolver.resolve(options.option(PROJECT_DIR).getValue()));
        }
        if (options.hasOption(GRADLE_USER_HOME)) {
            startParameter.setGradleUserHomeDir(resolver.resolve(options.option(GRADLE_USER_HOME).getValue()));
        }
        if (options.hasOption(BUILD_FILE)) {
            startParameter.setBuildFile(resolver.resolve(options.option(BUILD_FILE).getValue()));
        }
        if (options.hasOption(SETTINGS_FILE)) {
            startParameter.setSettingsFile(resolver.resolve(options.option(SETTINGS_FILE).getValue()));
        }

        for (String script : options.option(INIT_SCRIPT).getValues()) {
            startParameter.addInitScript(resolver.resolve(script));
        }

        if (options.hasOption(CACHE)) {
            try {
                startParameter.setCacheUsage(CacheUsage.fromString(options.option(CACHE).getValue()));
View Full Code Here

Examples of org.gradle.api.internal.file.FileResolver

*/
public class Sync extends AbstractCopyTask {
    private FileCopyActionImpl action;

    public Sync() {
        FileResolver fileResolver = getServices().get(FileResolver.class);
        action = new FileCopyActionImpl(fileResolver, new SyncCopySpecVisitor(new FileCopySpecVisitor()));
    }
View Full Code Here

Examples of org.gradle.api.internal.file.FileResolver

*/
public class JavaExec extends ConventionTask implements JavaExecSpec {
    private JavaExecAction javaExecHandleBuilder;

    public JavaExec() {
        FileResolver fileResolver = getServices().get(FileResolver.class);
        javaExecHandleBuilder = new DefaultJavaExecAction(fileResolver);
    }
View Full Code Here

Examples of org.gradle.api.internal.file.FileResolver

    }

    @Test
    public void calculatesReportsDirFromReportsDirName() {
        context.checking(new Expectations(){{
            FileResolver fileResolver = context.mock(FileResolver.class);
            FileResolver buildDirResolver = context.mock(FileResolver.class, "buildDir");
            allowing(project).getFileResolver();
            will(returnValue(fileResolver));
            one(fileResolver).withBaseDir(buildDir);
            will(returnValue(buildDirResolver));
            one(buildDirResolver).resolve("new-reports");
View Full Code Here

Examples of org.gradle.api.internal.file.FileResolver

        abstract String dependentTaskName(SourceSet sourceSet);
    }

    private static void setupTask(ProjectInternal project, SourceSet sourceSet, Flavor f) {
        String dirPath = String.format("src/%s/%s", sourceSet.getName(), f.templatesPart());
        FileResolver fileResolver = project.getFileResolver();
        File dir = fileResolver.resolve(dirPath);
        if (!dir.exists())
            return;
        // for each source set we will:
        // 1) Add a new 'javaTemplates' or 'resourceTemplates' source dirs
        String sourceSetName = ((DefaultSourceSet) sourceSet).getDisplayName();
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.