Search in sources :

Example 1 with FileLink

use of uk.me.parabola.imgfmt.sys.FileLink in project mkgmap by openstreetmap.

the class FileCopier method addFile.

private void addFile(FileSystem outfs, FileInfo info) {
    String filename = info.getFilename();
    FileCopier fc = new FileCopier(filename);
    try {
        ImgChannel chan = outfs.create(createImgFilename(filename));
        ((FileLink) chan).link(info.subFiles().get(0), fc.file(chan));
    } catch (FileExistsException e) {
        log.warn("Counld not copy " + filename, e);
    }
}
Also used : FileImgChannel(uk.me.parabola.imgfmt.sys.FileImgChannel) ImgChannel(uk.me.parabola.imgfmt.fs.ImgChannel) FileLink(uk.me.parabola.imgfmt.sys.FileLink) FileExistsException(uk.me.parabola.imgfmt.FileExistsException)

Example 2 with FileLink

use of uk.me.parabola.imgfmt.sys.FileLink in project mkgmap by openstreetmap.

the class FileCopier method addImg.

private void addImg(FileSystem outfs, FileInfo info) {
    FileCopier fc = new FileCopier(info.getFilename());
    List<SubFileInfo> subFiles = info.subFiles();
    for (SubFileInfo sf : subFiles) {
        try {
            ImgChannel chan = outfs.create(sf.getName());
            Closeable sync = fc.add(sf.getName(), chan);
            ((FileLink) chan).link(sf, sync);
        } catch (FileExistsException e) {
            log.warn("Could not copy " + sf.getName(), e);
        }
    }
}
Also used : FileImgChannel(uk.me.parabola.imgfmt.sys.FileImgChannel) ImgChannel(uk.me.parabola.imgfmt.fs.ImgChannel) Closeable(java.io.Closeable) FileLink(uk.me.parabola.imgfmt.sys.FileLink) FileExistsException(uk.me.parabola.imgfmt.FileExistsException)

Aggregations

FileExistsException (uk.me.parabola.imgfmt.FileExistsException)2 ImgChannel (uk.me.parabola.imgfmt.fs.ImgChannel)2 FileImgChannel (uk.me.parabola.imgfmt.sys.FileImgChannel)2 FileLink (uk.me.parabola.imgfmt.sys.FileLink)2 Closeable (java.io.Closeable)1