本文整理匯總了Java中java.io.File.getClass方法的典型用法代碼示例。如果您正苦於以下問題:Java File.getClass方法的具體用法?Java File.getClass怎麽用?Java File.getClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.io.File
的用法示例。
在下文中一共展示了File.getClass方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getMoveHandler
import java.io.File; //導入方法依賴的package包/類
@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: getCopyHandler
import java.io.File; //導入方法依賴的package包/類
@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: toDebugString
import java.io.File; //導入方法依賴的package包/類
static String toDebugString(File file) {
if (file == null) {
return "NULL-ref"; // NOI18N
} else {
return file.getPath() + "(" + file.getClass() + ")"; // NOI18N
}
}
示例4: beforeMove
import java.io.File; //導入方法依賴的package包/類
public void beforeMove(FileObject fo, File to) {
to.getClass();
assertLock();
beforeMoveCalls++;
}
示例5: moveSuccess
import java.io.File; //導入方法依賴的package包/類
public void moveSuccess(FileObject fo, File to) {
to.getClass();
assertLock();
moveSuccessCalls++;
}
示例6: moveFailure
import java.io.File; //導入方法依賴的package包/類
public void moveFailure(FileObject fo, File to) {
to.getClass();
assertLock();
moveFailureCalls++;
}
示例7: beforeCopy
import java.io.File; //導入方法依賴的package包/類
public void beforeCopy(FileObject fo, File to) {
to.getClass();
assertLock();
beforeCopyCalls++;
}
示例8: copySuccess
import java.io.File; //導入方法依賴的package包/類
public void copySuccess(FileObject fo, File to) {
to.getClass();
assertLock();
copySuccessCalls++;
}
示例9: copyFailure
import java.io.File; //導入方法依賴的package包/類
public void copyFailure(FileObject fo, File to) {
to.getClass();
assertLock();
copyFailureCalls++;
}
示例10: B
import java.io.File; //導入方法依賴的package包/類
public B(A a, File file) {
super(a, file.getClass());
this.t = file;
}