Package com.taobao.zeus.model

Examples of com.taobao.zeus.model.FileDescriptor


    }
  }

  @Override
  public void updateFileName(String fileId, String name) {
    FileDescriptor fd=fileManager.getFile(fileId);
    String user=LoginUser.getUser().getUid();
    if(fd.getParent()==null){
      throw new RuntimeException("不允许修改此文件夹名称");
    }
    if(Super.getSupers().contains(user) || fd.getOwner().equalsIgnoreCase(user)){
      fd.setName(name);
      fileManager.update(fd);
    }else{
      throw new RuntimeException("权限不足");
    }
   
View Full Code Here


    return ;
  }

  @Override
  public void moveFile(String sourceId, String targetId) {
    FileDescriptor source=fileManager.getFile(sourceId);
    FileDescriptor target=fileManager.getFile(targetId);
    String uid=LoginUser.getUser().getUid();
    if(target.isFolder() && target.getOwner().equals(source.getOwner())){
      if(Super.getSupers().contains(uid)|| (source.getOwner().equalsIgnoreCase(uid) && target.getOwner().equalsIgnoreCase(uid))){
        source.setParent(target.getId());
        fileManager.update(source);
      }else{
        throw new RuntimeException("权限不足");
      }
    }else{
View Full Code Here

  @Override
  public String debug(String fileId, String mode, String script)
      throws GwtException {

    String uid = LoginUser.getUser().getUid();
    FileDescriptor fd = fileManager.getFile(fileId);
    if (!fd.getOwner().equals(uid)) {
      throw new RuntimeException("您无权操作");
    }

    DebugHistory history = new DebugHistory();
    history.setFileId(fileId);
View Full Code Here

  @Override
  public void cancelDebug(String debugId) throws GwtException {
    String uid = LoginUser.getUser().getUid();
    DebugHistory his = debugHistoryManager.findDebugHistory(debugId);
    FileDescriptor fd = fileManager.getFile(his.getFileId());
    if (!fd.getOwner().equals(uid) && !Super.getSupers().contains(uid)) {
      throw new RuntimeException("您无权操作\nuid=" + uid + " fileOwner="
          + fd.getOwner());
    }
    try {
      worker.cancelJobFromWeb(ExecuteKind.DebugKind, debugId, LoginUser
          .getUser().getUid());
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.taobao.zeus.model.FileDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.