java.io.File#getClass ( )源码实例Demo

下面列出了java.io.File#getClass ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: ProvidedExtensionsTest.java
@Override
public ProvidedExtensions.IOHandler getMoveHandler(final File from, final File to) {
    to.getClass();
    implsMoveCalls++;
    return (!isImplsMoveRetVal() || to == null) ? null : new ProvidedExtensions.IOHandler(){
        public void handle() throws IOException {
            moveImplCalls++;
            if (to.exists()) {
                throw new IOException();
            }
            assertTrue(from.exists());
            assertFalse(to.exists());
            
            assertFalse(from.equals(to));
            if (from.isDirectory()) {
                from.renameTo(to);
            } else {
                InputStream inputStream = new FileInputStream(from);
                OutputStream outputStream = new FileOutputStream(to);
                try {
                    FileUtil.copy(inputStream, outputStream);
                } finally {
                    if (inputStream != null) inputStream.close();
                    if (outputStream != null) outputStream.close();
                }
                to.setLastModified(from.lastModified());
                assertTrue(from.delete());
            }
            
            assertFalse(from.exists());
            assertTrue(to.exists());
        }
    };
}
 
源代码2 项目: netbeans   文件: ProvidedExtensionsTest.java
@Override
public ProvidedExtensions.IOHandler getCopyHandler(final File from, final File to) {
    to.getClass();
    if (from.isDirectory()) {
        return null;
    }
    implsCopyCalls++;
    return (!isImplsCopyRetVal() || to == null) ? null : new ProvidedExtensions.IOHandler(){
        @Override
        public void handle() throws IOException {
            copyImplCalls++;
            if (to.exists()) {
                throw new IOException();
            }
            assertTrue(from.exists());
            assertFalse(to.exists());
            
            assertFalse(from.equals(to));
            InputStream inputStream = new FileInputStream(from);
            OutputStream outputStream = new FileOutputStream(to);
            try {
                FileUtil.copy(inputStream, outputStream);
            } finally {
                if (inputStream != null) inputStream.close();
                if (outputStream != null) outputStream.close();
            }
            assertTrue(from.exists());
            assertTrue(to.exists());
        }
    };
}
 
源代码3 项目: netbeans   文件: FileUtil.java
static String toDebugString(File file) {
    if (file == null) {
        return "NULL-ref"; // NOI18N
    } else {
        return file.getPath() + "(" + file.getClass() + ")"; // NOI18N
    }
}
 
源代码4 项目: lua-for-android   文件: FileUtils.java
public static boolean startsWith(File f,File s){
    return f.getClass()==s.getClass()&&(f.getPath().equals(s.getPath())||f.getParentFile().getPath().startsWith(s.getPath()));
}
 
源代码5 项目: netbeans   文件: ProvidedExtensionsTest.java
public void beforeMove(FileObject fo, File to) {
    to.getClass();
    assertLock();
    beforeMoveCalls++;
}
 
源代码6 项目: netbeans   文件: ProvidedExtensionsTest.java
public void moveSuccess(FileObject fo, File to) {
    to.getClass();
    assertLock();
    moveSuccessCalls++;
}
 
源代码7 项目: netbeans   文件: ProvidedExtensionsTest.java
public void moveFailure(FileObject fo, File to) {
    to.getClass();
    assertLock();
    moveFailureCalls++;
}
 
源代码8 项目: netbeans   文件: ProvidedExtensionsTest.java
public void beforeCopy(FileObject fo, File to) {
    to.getClass();
    assertLock();
    beforeCopyCalls++;
}
 
源代码9 项目: netbeans   文件: ProvidedExtensionsTest.java
public void copySuccess(FileObject fo, File to) {
    to.getClass();
    assertLock();
    copySuccessCalls++;
}
 
源代码10 项目: netbeans   文件: ProvidedExtensionsTest.java
public void copyFailure(FileObject fo, File to) {
    to.getClass();
    assertLock();
    copyFailureCalls++;
}