| File recursive-patch.txt,
1.1 KB
(added by jmoore, 13 years ago) |
|
And a text view because who likes to download a zip.
|
| Line | |
|---|
| 1 | Index: romio/src/ome/io/nio/PixelsService.java |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- romio/src/ome/io/nio/PixelsService.java (revision 887) |
|---|
| 4 | +++ romio/src/ome/io/nio/PixelsService.java (working copy) |
|---|
| 5 | @@ -28,6 +28,7 @@ |
|---|
| 6 | */ |
|---|
| 7 | package ome.io.nio; |
|---|
| 8 | |
|---|
| 9 | +import java.io.File; |
|---|
| 10 | import java.io.FileOutputStream; |
|---|
| 11 | import java.io.IOException; |
|---|
| 12 | |
|---|
| 13 | @@ -74,6 +75,7 @@ |
|---|
| 14 | throws IOException |
|---|
| 15 | { |
|---|
| 16 | String path = getPixelsPath(pixbuf.getId()); |
|---|
| 17 | + recursivelyCreateDirectory( new File(path).getParent()); |
|---|
| 18 | byte[] padding = new byte[pixbuf.getPlaneSize() - NULL_PLANE_SIZE]; |
|---|
| 19 | FileOutputStream stream = new FileOutputStream(path); |
|---|
| 20 | |
|---|
| 21 | @@ -89,4 +91,19 @@ |
|---|
| 22 | } |
|---|
| 23 | } |
|---|
| 24 | } |
|---|
| 25 | + |
|---|
| 26 | + private void recursivelyCreateDirectory(String path) |
|---|
| 27 | + { |
|---|
| 28 | + File dir = new File(path); |
|---|
| 29 | + File parent = new File(dir.getParent()); |
|---|
| 30 | + if ( ! parent.exists() ) |
|---|
| 31 | + { |
|---|
| 32 | + recursivelyCreateDirectory(dir.getParent()); |
|---|
| 33 | + } |
|---|
| 34 | + if ( ! dir.exists() ) |
|---|
| 35 | + { |
|---|
| 36 | + dir.mkdir(); |
|---|
| 37 | + } |
|---|
| 38 | + |
|---|
| 39 | + } |
|---|
| 40 | } |
|---|
Download in other formats:
1.3.13-PRO © 2008-2011
Agilo Software all
rights reserved
(this page was served in: 0.38364 sec.)