当前位置: 首页>>代码示例>>Java>>正文


Java FileSystemView.getFiles方法代码示例

本文整理汇总了Java中javax.swing.filechooser.FileSystemView.getFiles方法的典型用法代码示例。如果您正苦于以下问题:Java FileSystemView.getFiles方法的具体用法?Java FileSystemView.getFiles怎么用?Java FileSystemView.getFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.filechooser.FileSystemView的用法示例。


在下文中一共展示了FileSystemView.getFiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import javax.swing.filechooser.FileSystemView; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS &&
            OSInfo.getWindowsVersion().compareTo(OSInfo.WINDOWS_VISTA) > 0 ) {
        FileSystemView fsv = FileSystemView.getFileSystemView();
        for (File file : fsv.getFiles(fsv.getHomeDirectory(), false)) {
            if(file.isDirectory()) {
                for (File file1 : fsv.getFiles(file, false)) {
                    if(file1.isDirectory())
                    {
                        String path = file1.getPath();
                        if(path.startsWith("::{") &&
                                path.toLowerCase().endsWith(".library-ms")) {
                            throw new RuntimeException("Unconverted library link found");
                        }
                    }
                }
            }
        }
    }
    System.out.println("ok");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:bug8003399.java

示例2: run

import javax.swing.filechooser.FileSystemView; //导入方法依赖的package包/类
public void run() {
    final Vector<DoChangeContents> runnables = new Vector<DoChangeContents>(10);
    final FileSystemView fileSystem = filechooser.getFileSystemView();

    final File[] list = fileSystem.getFiles(currentDirectory, filechooser.isFileHidingEnabled());

    final Vector<Object> acceptsList = new Vector<Object>();

    for (final File element : list) {
        // Return all files to the file chooser. The UI will disable or enable
        // the file name if the current filter approves.
        acceptsList.addElement(new SortableFile(element));
    }

    // Sort based on settings.
    sort(acceptsList);

    // Don't separate directories from files
    Vector<SortableFile> chunk = new Vector<SortableFile>(10);
    final int listSize = acceptsList.size();
    // run through list grabbing file/dirs in chunks of ten
    for (int i = 0; i < listSize;) {
        SortableFile f;
        for (int j = 0; j < 10 && i < listSize; j++, i++) {
            f = (SortableFile)acceptsList.elementAt(i);
            chunk.addElement(f);
        }
        final DoChangeContents runnable = new DoChangeContents(chunk, fid);
        runnables.addElement(runnable);
        SwingUtilities.invokeLater(runnable);
        chunk = new Vector<SortableFile>(10);
        if (isInterrupted()) {
            // interrupted, cancel all runnables
            cancelRunnables(runnables);
            return;
        }
    }

    synchronized (fileCacheLock) {
        for (final Runnable r : queuedTasks) {
            SwingUtilities.invokeLater(r);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:AquaFileSystemModel.java

示例3: run

import javax.swing.filechooser.FileSystemView; //导入方法依赖的package包/类
public void run() {
    FileSystemView fileSystemView = FileSystemView.getFileSystemView();

    fileSystemView.getFiles(new File(dir), false);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:bug6868611.java

示例4: run

import javax.swing.filechooser.FileSystemView; //导入方法依赖的package包/类
@Override
public void run() {
    final Vector<DoChangeContents> runnables = new Vector<DoChangeContents>(10);
    final FileSystemView fileSystem = filechooser.getFileSystemView();

    final File[] list = fileSystem.getFiles(currentDirectory, filechooser.isFileHidingEnabled());

    final Vector<Object> acceptsList = new Vector<Object>();

    for (final File element : list) {
        // Return all files to the file chooser. The UI will disable or enable
        // the file name if the current filter approves.
        acceptsList.addElement(new SortableFile(element));
    }

    // Sort based on settings.
    sort(acceptsList);

    // Don't separate directories from files
    Vector<SortableFile> chunk = new Vector<SortableFile>(10);
    final int listSize = acceptsList.size();
    // run through list grabbing file/dirs in chunks of ten
    for (int i = 0; i < listSize;) {
        SortableFile f;
        for (int j = 0; j < 10 && i < listSize; j++, i++) {
            f = (SortableFile)acceptsList.elementAt(i);
            chunk.addElement(f);
        }
        final DoChangeContents runnable = new DoChangeContents(chunk, fid);
        runnables.addElement(runnable);
        SwingUtilities.invokeLater(runnable);
        chunk = new Vector<SortableFile>(10);
        if (loadThread.isInterrupted()) {
            // interrupted, cancel all runnables
            cancelRunnables(runnables);
            return;
        }
    }

    synchronized (fileCacheLock) {
        for (final Runnable r : queuedTasks) {
            SwingUtilities.invokeLater(r);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:46,代码来源:AquaFileSystemModel.java


注:本文中的javax.swing.filechooser.FileSystemView.getFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。