瀏覽代碼

copy role from classpath to local storage in exists check

tags/v0.9.11
Jonathan Cobb 4 年之前
父節點
當前提交
eca8620ca9
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      bubble-server/src/main/java/bubble/cloud/storage/local/LocalStorageDriver.java

+ 7
- 1
bubble-server/src/main/java/bubble/cloud/storage/local/LocalStorageDriver.java 查看文件

@@ -86,7 +86,13 @@ public class LocalStorageDriver extends CloudServiceDriverBase<LocalStorageConfi

// check classpath
@Cleanup final InputStream in = getClass().getClassLoader().getResourceAsStream(key);
return in != null;
if (in == null) return false;

// copy file to root network storage, so we can find it after activation
if (!file.getParentFile().mkdirs()) return false;
@Cleanup OutputStream out = new FileOutputStream(file);
IOUtils.copyLarge(in, out);
return true;
}

protected File metaFile(File f) { return new File(abs(f)+SUFFIX_META); }


Loading…
取消
儲存