ディレクトリ内のファイルを移動します

ファイルを移動します

パッケージcom.vfsd.core。

インポートのjava.io.File; 

パブリック クラスLISTFILES { 

    公共の 静的な 無効メイン(文字列[] args)を
    { 
        // ファイルDIR1 =新しいファイル( "O:\\ OpenSceneGraph \\ OpenSceneGraph_3_6_install \\ libに"); 
        ファイルDIR1 = 新しいファイル( "E:\\ OpenSceneGraph \\ OpenSceneGraph_3_4_install \\ libに" );
        // ファイルDIR1 =新しいファイル( "E:\\ジオス\\ geos_3_5_install \\ libに");
        // ファイルDIR1 =新しいファイル( "E:\\ GDAL \\ gdal212_install \\ libに");
        // ファイルDIR1 =新しいファイル( "E:\\ CURL \\ curl_install \\ libに");
        //=新しいファイルdir1のファイル( "E:\\ OpenSceneGraph \\ 3rdParty \\ V140-のx64 \\ libが");
        // ファイルDIR1 =新しいファイル( "E:\\ OpenCVの\\ \\ opencv_3_4_6_installのlib");
        // ファイルDIR1 =新しいファイル( "E:\\ boost_1_70_0 \\ vc14-x64の\\ libの"); 
        
        // ファイルDIR1 =新しいファイル( "K:\\ Qtの\\ \\ Qt5.9.6 5.9.6 \\ msvc2015_64 \\ libに"); 
        listDir1(DIR1)。
    } 
    
    パブリック 静的 ボイドlistDir1(dirParamファイル)
    { 
        ファイル[] files1 = dirParam.listFiles()。
        int型のk = 0; K <files1.length; ++ k個
        { 
            ファイルfileIndex = files1 [K]。
            もし(fileIndex.isFile())
            { 
                // もし(!fileIndex.getName()。endsWith( "d.lib")&&!fileIndex.getName()。endsWith( "PRL")&&!fileIndex.getName()。 endsWith( "cmakeの。 "))
                であれば(fileIndex.getName()endsWith(" d.lib"。 ))
                { 
                    System.out.printlnは(fileIndex.getName())。
                    // するSystem.out.println(fileIndex.getPath()); 
                }
                 // するSystem.out.println(fileIndex.getPath())。
            } そう であれば(fileIndex.isDirectory())
            { 
                listDir1(fileIndex)。
            } 
        } 
    } 
}

 

おすすめ

転載: www.cnblogs.com/herd/p/11517567.html