当前位置: 首页>>代码示例>>Java>>正文


Java IFileStore.mkdir方法代码示例

本文整理汇总了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();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:43,代码来源:FileStore.java


注:本文中的org.eclipse.core.filesystem.IFileStore.mkdir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。