Examples of GridShiftFile


Examples of au.com.objectix.jgridshift.GridShiftFile

        if(gridLocation == null) {
            throw new FactoryException("The grid location must be not null");
        }
       
        synchronized (ntv2GridCache) { // Prevent simultaneous threads trying to load same grid
            GridShiftFile grid = ntv2GridCache.get(gridLocation.toExternalForm());
            if (grid != null) { // Cached:
                return grid; // - Return
            } else { // Not cached:
                if (gridLocation != null) {
                    grid = loadNTv2Grid(gridLocation); // - Load
View Full Code Here

Examples of au.com.objectix.jgridshift.GridShiftFile

                }

                raf = new RandomAccessFile(file, "r");

                // will throw an exception if not a valid file
                new GridShiftFile().loadGridShiftFile(raf);
            } else {
                InputStream in = new BufferedInputStream(url.openConnection().getInputStream());

                // will throw an exception if not a valid file
                new GridShiftFile().loadGridShiftFile(in, false);
            }

            return true; // No exception thrown => valid file.
        } catch (IllegalArgumentException e) {
            // This usually means resource is not a valid NTv2 file.
View Full Code Here

Examples of au.com.objectix.jgridshift.GridShiftFile

     * @throws FactoryException
     */
    private GridShiftFile loadNTv2Grid(URL location) throws FactoryException {
        InputStream in = null;
        try {
            GridShiftFile grid = new GridShiftFile();
            in = new BufferedInputStream(location.openStream());
            grid.loadGridShiftFile(in, false); // Load full grid in memory
            in.close();
            return grid;
        } catch (FileNotFoundException e) {
            LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
            return null;
View Full Code Here

Examples of au.com.objectix.jgridshift.GridShiftFile

        }
        assertTrue(factoryExceptionThrown);
   
        // Create a grid from the test file
        factoryExceptionThrown = false;
        GridShiftFile grid = null;
        try {
            grid = factory.createNTv2Grid(TEST_GRID);
        } catch (FactoryException e) {
            factoryExceptionThrown = true;
        }
        assertFalse(factoryExceptionThrown);
        assertNotNull(grid);
        assertTrue(grid.isLoaded());
    }
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.