Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.ID.toFile()


public class ShpPropertiesInterceptor implements ServiceInterceptor {

    public void run(IService service){
        if( service instanceof ShpServiceImpl){
            ID id = service.getID();
            File directory = id.toFile().getParentFile();
            File infoFile = new File( directory, id.toBaseFile()+".properties" );
            if( infoFile.exists() ){
               try {
                   FileReader infoReader = new FileReader( infoFile );
                 Properties info = new Properties();
View Full Code Here


            return Messages.GeoTiffServiceExtension_badExt;
       
        File file = null;
        try {
            ID id = new ID( url );
            file = id.toFile();
        } catch (IllegalArgumentException ex) {
            return url.toExternalForm()+Messages.GeoTiffServiceExtension_notFile;
        }
       
        if (!file.exists() )
View Full Code Here

            public void widgetSelected( SelectionEvent e ) {
                IGeoResource geoResource = layer.getGeoResource();
                ID id = geoResource.getID();
                if (id.isFile()) {
                    try {
                        File file = id.toFile();
                        polygonStyleManager.exportStyle(styleWrapper, file);
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                } else {
View Full Code Here

            public void widgetSelected( SelectionEvent e ) {
                IGeoResource geoResource = layer.getGeoResource();
                ID id = geoResource.getID();
                if (id.isFile()) {
                    try {
                        File file = id.toFile();
                        pointStyleManager.exportStyle(styleWrapper, file);
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                } else {
View Full Code Here

            public void widgetSelected( SelectionEvent e ) {
                IGeoResource geoResource = layer.getGeoResource();
                ID id = geoResource.getID();
                if (id.isFile()) {
                    try {
                        File file = id.toFile();
                        lineStyleManager.exportStyle(styleWrapper, file);
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                } else {
View Full Code Here

     */
    public File createPropertiesFile() {
        File file = getPropertiesFile();
        if (file == null) {
            final ID fileId = new ID(url);
            file = fileId.toFile(PROP_FILE_EXT);
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

                            }
                            if (geoResource != null) {
                                ID id = geoResource.getID();
                                if (id != null)
                                    if (id.isFile()) {
                                        File file = id.toFile();
                                        if (file.exists()) {
                                            setTextContent(file);
                                            OmsBoxPlugin.getDefault().setLastFolderChosen(file.getParentFile().getAbsolutePath());
                                        }
                                    } else if (id.toString().contains("#") && id.toString().startsWith("file")) {
View Full Code Here

    public String getTitle() {
        ID id = service.getID();
       
        String title;
        if( id.isFile() ){
            title = id.toFile().getAbsolutePath();           
        }
        else {
            title = id.toString();
        }
        return title;
View Full Code Here

        if (this.reader == null) {
            try {
                AbstractGridFormat frmt = (AbstractGridFormat) getFormat();
                ID id = getID();
                if( id.isFile() ){
                    File file = id.toFile();
                    if (file != null) {
                        // to force crs
                        // Hints hints = new Hints();
                        // hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, )
                        this.reader = (AbstractGridCoverage2DReader) frmt.getReader(file);
View Full Code Here

                        // hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, )
                        this.reader = (AbstractGridCoverage2DReader) frmt.getReader(file);
                        return this.reader;
                  }
                  else {
                    throw new FileNotFoundException( id.toFile().toString() );
                  }
                }
                this.reader = (AbstractGridCoverage2DReader) frmt.getReader( id.toURL() );
            } catch (Exception ex) {
                this.message = ex;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.