本文整理汇总了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;
}