private void commonInitializer(File file) throws IOException { File parent = file.getParentFile(); if (parent == null) parent = new File(System.getProperty("user.dir")); if (!parent.canWrite()) { String msg = Logging.getMessage("generic.FolderNoWritePermission", parent.getAbsolutePath()); Logging.logger().severe(msg); throw new IllegalArgumentException(msg); } this.targetFile = new RandomAccessFile(file, "rw"); this.theChannel = this.targetFile.getChannel(); }
public ComposeImageTile(Sector sector, String mimeType, Level level, int width, int height) throws IOException { super(sector, level, -1, -1); // row and column aren't used and need to signal that this.width = width; this.height = height; this.file = File.createTempFile(WWIO.DELETE_ON_EXIT_PREFIX, WWIO.makeSuffixForMimeType(mimeType)); }