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


Java IServer.PUBLISH_FULL属性代码示例

本文整理汇总了Java中org.eclipse.wst.server.core.IServer.PUBLISH_FULL属性的典型用法代码示例。如果您正苦于以下问题:Java IServer.PUBLISH_FULL属性的具体用法?Java IServer.PUBLISH_FULL怎么用?Java IServer.PUBLISH_FULL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.wst.server.core.IServer的用法示例。


在下文中一共展示了IServer.PUBLISH_FULL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: publishJar

protected void publishJar(String jarURI, Properties properties, List<IStatus> statuses,
    IProgressMonitor monitor) throws CoreException {
  IPath path = getModuleDeployDirectory(module[0]);
  boolean moving = false;
  // Get URI used for previous publish, if known
  String oldURI = (String) properties.get(module[1].getId());
  if (oldURI != null) {
    // If old URI found, detect if jar is moving or changing its name
    if (jarURI != null) {
      moving = !oldURI.equals(jarURI);
    }
  }
  // If we don't have a jar URI, make a guess so we have one if we need it
  if (jarURI == null) {
    jarURI = "WEB-INF/lib/" + module[1].getName() + ".jar";
  }
  IPath jarPath = path.append(jarURI);
  // Make our best determination of the path to the old jar
  IPath oldJarPath = jarPath;
  if (oldURI != null) {
    oldJarPath = path.append(oldURI);
  }
  // Establish the destination directory
  path = jarPath.removeLastSegments(1);

  // Remove if requested or if previously published and are now serving without publishing
  if (moving || kind == IServer.PUBLISH_CLEAN || deltaKind == ServerBehaviourDelegate.REMOVED
      || isServeModulesWithoutPublish()) {
    File file = oldJarPath.toFile();
    if (file.exists())
      file.delete();
    properties.remove(module[1].getId());

    if (deltaKind == ServerBehaviourDelegate.REMOVED
        || isServeModulesWithoutPublish())
      return;
  }
  if (!moving && kind != IServer.PUBLISH_CLEAN && kind != IServer.PUBLISH_FULL) {
    // avoid changes if no changes to module since last publish
    IModuleResourceDelta[] delta = getPublishedResourceDelta(module);
    if (delta == null || delta.length == 0)
      return;
  }

  // make directory if it doesn't exist
  if (!path.toFile().exists()) {
    path.toFile().mkdirs();
  }

  IModuleResource[] mr = getResources(module);
  IStatus[] status = helper.publishZip(mr, jarPath, monitor);
  addArrayToList(statuses, status);
  properties.put(module[1].getId(), jarURI);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:54,代码来源:BasePublishOperation.java

示例2: publishArchiveModule

protected void publishArchiveModule(String jarURI, Properties p, List<IStatus> statuses,
    IProgressMonitor monitor) {
  IPath path = getModuleDeployDirectory(module[0]);
  boolean moving = false;
  // Get URI used for previous publish, if known
  String oldURI = (String) p.get(module[1].getId());
  if (oldURI != null) {
    // If old URI found, detect if jar is moving or changing its name
    if (jarURI != null) {
      moving = !oldURI.equals(jarURI);
    }
  }
  // If we don't have a jar URI, make a guess so we have one if we need it
  if (jarURI == null) {
    jarURI = "WEB-INF/lib/" + module[1].getName();
  }
  IPath jarPath = path.append(jarURI);
  // Make our best determination of the path to the old jar
  IPath oldJarPath = jarPath;
  if (oldURI != null) {
    oldJarPath = path.append(oldURI);
  }
  // Establish the destination directory
  path = jarPath.removeLastSegments(1);

  // Remove if requested or if previously published and are now serving without publishing
  if (moving || kind == IServer.PUBLISH_CLEAN || deltaKind == ServerBehaviourDelegate.REMOVED
      || isServeModulesWithoutPublish()) {
    File file = oldJarPath.toFile();
    if (file.exists()) {
      file.delete();
    }
    p.remove(module[1].getId());

    if (deltaKind == ServerBehaviourDelegate.REMOVED
        || isServeModulesWithoutPublish()) {
      return;
    }
  }
  if (!moving && kind != IServer.PUBLISH_CLEAN && kind != IServer.PUBLISH_FULL) {
    // avoid changes if no changes to module since last publish
    IModuleResourceDelta[] delta = getPublishedResourceDelta(module);
    if (delta == null || delta.length == 0) {
      return;
    }
  }

  // make directory if it doesn't exist
  if (!path.toFile().exists()) {
    path.toFile().mkdirs();
  }

  IModuleResource[] mr = getResources(module);
  IStatus[] status = helper.publishToPath(mr, jarPath, monitor);
  addArrayToList(statuses, status);
  p.put(module[1].getId(), jarURI);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:57,代码来源:BasePublishOperation.java


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