當前位置: 首頁>>代碼示例>>Java>>正文


Java DirectoryScanner.setCaseSensitive方法代碼示例

本文整理匯總了Java中org.apache.tools.ant.DirectoryScanner.setCaseSensitive方法的典型用法代碼示例。如果您正苦於以下問題:Java DirectoryScanner.setCaseSensitive方法的具體用法?Java DirectoryScanner.setCaseSensitive怎麽用?Java DirectoryScanner.setCaseSensitive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.tools.ant.DirectoryScanner的用法示例。


在下文中一共展示了DirectoryScanner.setCaseSensitive方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: scanForFiles

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
private static void scanForFiles(Collection<File> destination, String pathAndMask) {
    DirectoryScanner scanner = new DirectoryScanner();
    scanner.setCaseSensitive(false);

    String pathPart = FilenameUtils.getFullPath(pathAndMask);
    if(StringUtils.isEmpty(pathPart))
    {
        scanner.setBasedir(Paths.get(".").toAbsolutePath().normalize().toFile());
        scanner.setIncludes(new String[]{pathAndMask});
    }
    else
    {
        scanner.setBasedir(new File(pathPart));
        scanner.setIncludes(new String[]{FilenameUtils.getName(pathAndMask)});
    }

    scanner.scan();
    for (String file : scanner.getIncludedFiles()) {
        destination.add(new File(scanner.getBasedir(),file));
    }
}
 
開發者ID:BigBrassBand,項目名稱:remittanceparse,代碼行數:22,代碼來源:Main.java

示例2: listFiles

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
@Override
public List<File> listFiles(final String mask) {
    try {
        DirectoryScanner scanner = new DirectoryScanner();
        scanner.setIncludes(new String[]{mask});
        scanner.setBasedir(this.basedir.replace("\\", "/"));
        scanner.setCaseSensitive(false);
        scanner.scan();
        String[] files = scanner.getIncludedFiles();
        List<File> result = new ArrayList<>();
        for (String file : files) {
            result.add(
                    new SimpleFile(file,
                            FileUtils.readFileToByteArray(new java.io.File(basedir + "/" + file))));
        }
        return result;
    } catch (IOException exception) {
        throw new BootException(exception);
    }
}
 
開發者ID:sql-boot,項目名稱:sql-boot,代碼行數:21,代碼來源:LocalFileSystem.java

示例3: downloadProjectSDK

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
/**
 * Downloads an SDK for needed language.
 *
 * @param lang     SDK language
 * @param response standard response
 * @throws SandboxServiceException if couldn't download
 */
@RequestMapping(value = "demoProjects/download/sdk/{lang}", method = RequestMethod.GET)
public void downloadProjectSDK(@PathVariable String lang, HttpServletResponse response) throws SandboxServiceException {
    String sdkPath = "/usr/lib/kaa-node/sdk/" + lang + "/";
    DirectoryScanner scanner = new DirectoryScanner();
    scanner.setIncludes(new String[]{"kaa-*"});
    scanner.setBasedir(sdkPath);
    scanner.setCaseSensitive(false);
    try {
        scanner.scan();
        String[] files = scanner.getIncludedFiles();
        if (files.length == 0) {
            LOG.warn("No SDK found for language [{}]", lang);
            return;
        }
        String sdkFullName = sdkPath + files[0];
        LOG.info("Downloading SDK [{}]", sdkFullName);
        response.setHeader("Content-disposition", "attachment; filename=" + files[0]);
        IOUtils.copy(Files.newInputStream(Paths.get(sdkFullName)), response.getOutputStream());
        response.flushBuffer();
    } catch (IOException e) {
        LOG.error("Couldn't download SDK for language [{}]", lang);
        throw new SandboxServiceException(e);
    }
}
 
開發者ID:kaaproject,項目名稱:sandbox-frame,代碼行數:32,代碼來源:SandboxController.java

示例4: removeTestClasses

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
/**
 * Remove as classes de teste do sistema, para que elas nao entrem na
 * analise. Todos os diretorios cujo nome comeca com 'test' (test*) serão
 * excluídos.
 */
public void removeTestClasses() {
	System.out.println("Deleting test folders");
	DirectoryScanner scanner = new DirectoryScanner();
	String[] includes = { "**/test*" };
	scanner.setIncludes(includes);
	scanner.setBasedir(src_path);
	scanner.setCaseSensitive(false);
	scanner.scan();

	String[] included_dirs = scanner.getIncludedDirectories();
	for (String test_dir : included_dirs) {
		File dirToDelete = new File(src_path, test_dir);
		if (dirToDelete.exists())
			FileUtils.deleteRecursive(dirToDelete);
	}
}
 
開發者ID:aserg-ufmg,項目名稱:ModularityCheck,代碼行數:22,代碼來源:VersionControlManager.java

示例5: getUserModuleLibFiles

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
/**
 * 獲取用戶模塊加載文件/目錄(集合)
 *
 * @return 用戶模塊加載文件/目錄(集合)
 */
public synchronized File[] getUserModuleLibFiles() {
    final DirectoryScanner scanner = new DirectoryScanner();
    scanner.setIncludes(getUserModuleLibPaths());
    scanner.setCaseSensitive(false);
    scanner.scan();
    final String[] filePaths = scanner.getIncludedDirectories();
    final File[] files = new File[filePaths.length];
    for (int index = 0; index < filePaths.length; index++) {
        files[index] = new File(filePaths[index]);
    }
    return GET_USER_MODULE_LIB_FILES_CACHE = files;
}
 
開發者ID:alibaba,項目名稱:jvm-sandbox,代碼行數:18,代碼來源:CoreConfigure.java

示例6: createDirectoryScanner

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
private DirectoryScanner createDirectoryScanner(File baseDir, String[] filterExcludePatterns, String[] filterIncludePatterns) {
    DirectoryScanner ds = new DirectoryScanner();
    ds.setBasedir(baseDir);
    ds.setCaseSensitive(false);
    ds.setFollowSymlinks(false);
    ds.setErrorOnMissingDir(false);

    if (filterIncludePatterns != null && filterIncludePatterns.length > 0) {
        ds.setIncludes(filterIncludePatterns);
    }
    if (filterExcludePatterns != null && filterExcludePatterns.length > 0) {
        ds.setExcludes(filterExcludePatterns);
    }
    return ds;
}
 
開發者ID:jenkinsci,項目名稱:checkmarx-plugin,代碼行數:16,代碼來源:Zipper.java

示例7: invoke

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
public String[] invoke(File basedir, VirtualChannel virtualChannel) throws IOException, InterruptedException {
    DirectoryScanner ds = new DirectoryScanner();
    String[] includes = { pattern };
    ds.setIncludes(includes);
    ds.setBasedir(basedir);
    ds.setCaseSensitive(true);
    ds.scan();

    return ds.getIncludedFiles();
}
 
開發者ID:Perlmint,項目名稱:massif-plugin,代碼行數:11,代碼來源:MassifResultsScanner.java

示例8: fetchPropertyFiles

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
private List<String> fetchPropertyFiles(File targetDirectory, TaskListener listener) {
    List<String> propertyFiles = new ArrayList<>();
    if (StringUtils.isNotEmpty(classificationsFilePattern)) {
        DirectoryScanner scanner = new DirectoryScanner();
        scanner.setIncludes(new String[]{classificationsFilePattern});
        scanner.setBasedir(targetDirectory);
        scanner.setCaseSensitive(false);
        scanner.scan();
        propertyFiles = getFullMetaDataPath(scanner.getIncludedFiles(), targetDirectory.toString());
        for (String propertyFile : propertyFiles) {
            log(listener, String.format("Found Properties File - %s ", propertyFile));
        }
    }
    return propertyFiles;
}
 
開發者ID:jenkinsci,項目名稱:cucumber-reports-plugin,代碼行數:16,代碼來源:CucumberReportPublisher.java

示例9: searchFiles

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
public static String[] searchFiles(String searchPath, String searchString) {

        DirectoryScanner scanner = new DirectoryScanner();
        scanner.setIncludes(new String[]{searchString + "*.php"});

        scanner.setBasedir(searchPath);
        scanner.setCaseSensitive(false);
        scanner.scan();
        return scanner.getIncludedFiles();

    }
 
開發者ID:cmazx,項目名稱:yiistorm,代碼行數:12,代碼來源:CompleterHelper.java

示例10: searchFolders

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
public static String[] searchFolders(String searchPath, String searchString) {
    DirectoryScanner scanner = new DirectoryScanner();
    scanner.setIncludes(new String[]{searchString + "*"});
    scanner.setExcludes(new String[]{searchString + "*.php"});

    scanner.setBasedir(searchPath);
    scanner.setCaseSensitive(false);
    scanner.scan();
    return scanner.getIncludedDirectories();
}
 
開發者ID:cmazx,項目名稱:yiistorm,代碼行數:11,代碼來源:CompleterHelper.java

示例11: processProjectDir

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
private void processProjectDir(File f) {
    String prjPath = null;
    //if (f.getAbsolutePath().equals(baseDir.getAbsolutePath())) {
    //    prjPath = "";
    //} else {
        prjPath = f.getAbsolutePath().substring(baseDir.getAbsolutePath().length() + 1);
    //}
    log("Processing project dir: " + prjPath);
    DirectoryScanner ds = new DirectoryScanner();
    ds.setBasedir(f);
    ds.setIncludes(getAsArray(iconIncludes));
    ds.setExcludes(getAsArray(iconExcludes));
    ds.setCaseSensitive(false);
    ds.scan();
    String[] files = ds.getIncludedFiles();
    log("    Found " + files.length + " files in " + f);
    List<ImageInfo> goodIcons = new ArrayList<>();
    List<ImageInfo> badIcons = new ArrayList<>();
    for (String file : files) {
        String ext = file.substring(file.lastIndexOf('.') + 1);
        if (ext.equalsIgnoreCase("gif") || ext.equalsIgnoreCase("png")) {
            File iconFile = new File(f, file);
            try {
                ImageInfo imageInfo = null;
                imageInfo = readImageInfo(iconFile);
                if (imageInfo != null) {
                    imageInfo.setPath(file);
                    imageInfo.setExt(ext);
                    int w = imageInfo.getWidth();
                    int h = imageInfo.getHeight();
                    if ((w == 8 && h == 8) || (w == 16 && h == 16) ||
                        (w == 24 && h == 24) || (w == 32 && h == 32)) {
                        goodIcons.add(imageInfo);
                    } else {
                        badIcons.add(imageInfo);
                    }
                }
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }
    ProjectIconInfo prjIconInfo = new ProjectIconInfo(prjPath, goodIcons, badIcons);
    prjIconInfoList.add(prjIconInfo);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:46,代碼來源:CopyIcons.java

示例12: postProcessGeneratedJavadocs

import org.apache.tools.ant.DirectoryScanner; //導入方法依賴的package包/類
private void postProcessGeneratedJavadocs() throws IOException {
    if (!postProcessGeneratedJavadocs) {
        return;
    }
    if (destDir != null && !destDir.isDirectory()) {
        log("No javadoc created, no need to post-process anything",
            Project.MSG_VERBOSE);
        return;
    }
    final InputStream in = Javadoc.class
        .getResourceAsStream("javadoc-frame-injections-fix.txt");
    if (in == null) {
        throw new FileNotFoundException(
            "Missing resource 'javadoc-frame-injections-fix.txt' in classpath.");
    }
    final String fixData;
    try {
        fixData =
            fixLineFeeds(FileUtils
                         .readFully(new InputStreamReader(in, "US-ASCII")))
            .trim();
    } finally {
        FileUtils.close(in);
    }

    final DirectoryScanner ds = new DirectoryScanner();
    ds.setBasedir(destDir);
    ds.setCaseSensitive(false);
    ds.setIncludes(new String[] {
            "**/index.html", "**/index.htm", "**/toc.html", "**/toc.htm"
        });
    ds.addDefaultExcludes();
    ds.scan();
    int patched = 0;
    for (final String f : ds.getIncludedFiles()) {
        patched += postProcess(new File(destDir, f), fixData);
    }
    if (patched > 0) {
        log("Patched " + patched + " link injection vulnerable javadocs",
            Project.MSG_INFO);
    }
}
 
開發者ID:apache,項目名稱:ant,代碼行數:43,代碼來源:Javadoc.java


注:本文中的org.apache.tools.ant.DirectoryScanner.setCaseSensitive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。