mirror of
				https://github.com/lacerta-doc/Lacerta.git
				synced 2025-09-09 12:09:25 +00:00 
			
		
		
		
	実装 WIP
This commit is contained in:
		
							parent
							
								
									0d78f9fa7c
								
							
						
					
					
						commit
						9faf5c9055
					
				| 
						 | 
					@ -27,4 +27,5 @@ public interface FileManager {
 | 
				
			||||||
    FileManager setRootDir(Path rootDir);
 | 
					    FileManager setRootDir(Path rootDir);
 | 
				
			||||||
    FileManager setPath(Path path);
 | 
					    FileManager setPath(Path path);
 | 
				
			||||||
    FileManager setPath(String path);
 | 
					    FileManager setPath(String path);
 | 
				
			||||||
 | 
					    FileManager resolve(String path);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,7 +65,6 @@ public class FileManagerImpl implements FileManager {
 | 
				
			||||||
        return resolvedPath;
 | 
					        return resolvedPath;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public File getFileRef() {
 | 
					    public File getFileRef() {
 | 
				
			||||||
        return null;
 | 
					        return null;
 | 
				
			||||||
| 
						 | 
					@ -119,17 +118,30 @@ public class FileManagerImpl implements FileManager {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public FileManager setPath(Path path) {
 | 
					    public FileManager setPath(Path path) {
 | 
				
			||||||
        if (path.startsWith(this.rootDir)) {
 | 
					        if (this.disableRootDirCheck) {
 | 
				
			||||||
            this.path = path;
 | 
					            this.path = path;
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            if (this.autoCreate) {
 | 
					            if (path.startsWith(this.rootDir)) {
 | 
				
			||||||
 | 
					                this.path = path;
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                throw new IllegalArgumentException("path must be in rootDir");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        return this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public FileManager setPath(String path) {
 | 
					    public FileManager setPath(String path) {
 | 
				
			||||||
        return null;
 | 
					        return null;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public FileManager resolve(String path) {
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            this.path = resolveStringPath(path);
 | 
				
			||||||
 | 
					        } catch (IOException e) {
 | 
				
			||||||
 | 
					            e.printStackTrace();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user