| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | protected boolean run() { |
| 48 | // check if the input source has already been initialized |
| 49 | if(in == null) { |
| 50 | final IO io = IO.get(args[1]); |
| 51 | if(!io.exists()) return error(RES_NOT_FOUND_X, io); |
| 52 | in = io.inputSource(); |
| 53 | } |
| 54 | |
| 55 | final String path = MetaData.normPath(args[0]); |
| 56 | if(path == null) return error(PATH_INVALID_X, args[0]); |
| 57 | |
| 58 | final Data data = context.data(); |
| 59 | final IOFile bin = data.meta.file(path, ResourceType.BINARY); |
| 60 | |
| 61 | return update(data, () -> put(data, bin, path)); |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Puts (adds or replaces) resources in the specified database. |