Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/utils/MapfileGenerator.java @ 3306:1b41dc00b1f7
Create shapefile directory instead of shapefile 'file'
flys-artifacts/trunk@4992 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 13 Jul 2012 12:41:44 +0000 |
parents | 96daa8a4c48f |
children | 3dc26ec2558d |
comparison
equal
deleted
inserted
replaced
3305:b24920235944 | 3306:1b41dc00b1f7 |
---|---|
300 * | 300 * |
301 * @throws FileNotFoundException if no shapefile path is found or | 301 * @throws FileNotFoundException if no shapefile path is found or |
302 * configured. | 302 * configured. |
303 */ | 303 */ |
304 public File getShapefileBaseDir() | 304 public File getShapefileBaseDir() |
305 throws FileNotFoundException, IOException | 305 throws FileNotFoundException, IOException |
306 { | 306 { |
307 if (shapefileDirectory == null) { | 307 if (shapefileDirectory == null) { |
308 String path = FLYSUtils.getXPathString( | 308 String path = FLYSUtils.getXPathString( |
309 FLYSUtils.XPATH_SHAPEFILE_DIR); | 309 FLYSUtils.XPATH_SHAPEFILE_DIR); |
310 | 310 |
315 if (shapefileDirectory == null) { | 315 if (shapefileDirectory == null) { |
316 throw new FileNotFoundException("No shapefile directory given"); | 316 throw new FileNotFoundException("No shapefile directory given"); |
317 } | 317 } |
318 | 318 |
319 if (!shapefileDirectory.exists()) { | 319 if (!shapefileDirectory.exists()) { |
320 shapefileDirectory.createNewFile(); | 320 shapefileDirectory.mkdirs(); |
321 } | 321 } |
322 } | 322 } |
323 | 323 |
324 return shapefileDirectory; | 324 return shapefileDirectory; |
325 } | 325 } |
326 | 326 |
327 | 327 |
328 protected File[] getUserDirs() | 328 protected File[] getUserDirs() |
329 throws FileNotFoundException, IOException | 329 throws FileNotFoundException, IOException |
330 { | 330 { |
331 File baseDir = getShapefileBaseDir(); | 331 File baseDir = getShapefileBaseDir(); |
332 File[] artifactDirs = baseDir.listFiles(); | 332 File[] artifactDirs = baseDir.listFiles(); |
333 | 333 |
334 // TODO ONLY RETURN DIRECTORIES OF THE SPECIFIED USER | 334 // TODO ONLY RETURN DIRECTORIES OF THE SPECIFIED USER |
419 public void createBarriersLayer(FLYSArtifact flys, WMSLayerFacet wms) | 419 public void createBarriersLayer(FLYSArtifact flys, WMSLayerFacet wms) |
420 throws FileNotFoundException, IOException | 420 throws FileNotFoundException, IOException |
421 { | 421 { |
422 logger.debug("createBarriersLayer"); | 422 logger.debug("createBarriersLayer"); |
423 | 423 |
424 String uuid = flys.identifier(); | 424 //String uuid = flys.identifier(); |
425 File dir = new File(getShapefileBaseDir(), uuid); | 425 //File dir = new File(getShapefileBaseDir(), uuid); |
426 | 426 |
427 createBarriersLineLayer(flys, wms); | 427 createBarriersLineLayer(flys, wms); |
428 createBarriersPolygonLayer(flys, wms); | 428 createBarriersPolygonLayer(flys, wms); |
429 } | 429 } |
430 | 430 |