本文整理汇总了Java中org.eclipse.core.filesystem.IFileStore.mkdir方法的典型用法代码示例。如果您正苦于以下问题:Java IFileStore.mkdir方法的具体用法?Java IFileStore.mkdir怎么用?Java IFileStore.mkdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.filesystem.IFileStore
的用法示例。
在下文中一共展示了IFileStore.mkdir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyDirectory
import org.eclipse.core.filesystem.IFileStore; //导入方法依赖的package包/类
/**
* Recursively copies a directory as specified by {@link IFileStore#copy(IFileStore, int,
* IProgressMonitor)}.
*
* @param sourceInfo The current file information for the source of the move
* @param destination The destination of the copy.
* @param options bit-wise or of option flag constants ( {@link EFS#OVERWRITE} or {@link
* EFS#SHALLOW}).
* @param monitor a progress monitor, or <code>null</code> if progress reporting and cancellation
* are not desired
* @exception CoreException if this method fails. Reasons include:
* <ul>
* <li>This store does not exist.
* <li>A file of the same name already exists at the copy destination.
* </ul>
*/
protected void copyDirectory(
IFileInfo sourceInfo, IFileStore destination, int options, IProgressMonitor monitor)
throws CoreException {
try {
IFileStore[] children = null;
int opWork = 1;
if ((options & EFS.SHALLOW) == 0) {
children = childStores(EFS.NONE, null);
opWork += children.length;
}
monitor.beginTask("", opWork); // $NON-NLS-1$
monitor.subTask(NLS.bind(Messages.copying, toString()));
// create directory
destination.mkdir(EFS.NONE, Policy.subMonitorFor(monitor, 1));
// copy attributes
transferAttributes(sourceInfo, destination);
if (children == null) return;
// copy children
for (int i = 0; i < children.length; i++)
children[i].copy(
destination.getChild(children[i].getName()), options, Policy.subMonitorFor(monitor, 1));
} finally {
monitor.done();
}
}