Package org.davic.net

Examples of org.davic.net.InvalidLocatorException


        super(url);
       
        logger.info("Parsing locator " + url);

        if (!url.startsWith("bd://"))
            throw new InvalidLocatorException("Locator must start with bd:// (" + url + ")");

        Scanner scan = new Scanner(url.substring(5));

        scan.useDelimiter("[\\.:&]");

        try {
            while (scan.hasNext()) {
                String name = scan.next();
               
                if (scan.hasNext()) {
                    if (name.equals("JAR")) {
                        scan.useDelimiter("[:]");
                        String temp = scan.next();
                        jar = Integer.parseInt(temp.substring(0, 5));
                        isJarItem = true;
                       
                        if (temp.length() > 5)
                            pathSegments = temp.substring(5);
                    } else if (name.equals("SOUND")) {
                        sound = scan.nextInt(16);
                        isSoundItem = true;
                    } else if (name.equals("PLAYLIST")) {
                        playList = scan.nextInt();
                        isPlayItem = true;
                       
                        parsePlaylist(scan);
                    } else if (name.length() == 32)
                        disc = name;
                    else if (name.length() <= 4)
                        titleNum = Integer.parseInt(name, 16);
                    else
                        throw new InvalidLocatorException("Invalid identifier (" + url + ")");

                } else {
                    throw new InvalidLocatorException("Missing value (" + url + ")");
                }
            }
        } catch (InputMismatchException ex) {
            throw new InvalidLocatorException("Failed to parse value (" + url + ")");
        } catch (NumberFormatException ex) {
            throw new InvalidLocatorException("Failed to parse value (" + url + ")");
        }

       
    }
View Full Code Here


            else if (comp.startsWith("V2:"))
                secondaryVideoNum = Integer.parseInt(comp.substring(3));
            else if (comp.startsWith("P:"))
                textStreamNum = Integer.parseInt(comp.substring(2));
            else
                throw new InvalidLocatorException("Invalid component");
        }
    }
View Full Code Here

                    else if (name.length() == 32)
                        disc = name;
                    else if (name.length() <= 4)
                        titleNum = Integer.parseInt(name, 16);
                    else
                        throw new InvalidLocatorException("Invalid identifier");

                } else {
                    throw new InvalidLocatorException("Missing value");
                }
            }
        } catch (InputMismatchException ex) {
            throw new InvalidLocatorException("Failed to parse value");
        }
    }
View Full Code Here

            throws NotLoadedException, InvalidLocatorException,
            FileNotFoundException
    {
        BDLocator bdl = checkLocator(locator);
        if (bdl == null)
            throw new InvalidLocatorException("invalid BDLocator");
       
        if (bdl.isJarFileItem()) {
            String mountPt = MountManager.getMount(bdl.getJarFileId());
           
            if (mountPt == null)
                throw new NotLoadedException();
           
            DSMCCObject obj = new DSMCCObject(mountPt, bdl.getPathSegments());
           
            if (!obj.exists())
                throw new FileNotFoundException();
           
            return obj.getURL();
        }
       
        throw new InvalidLocatorException();
    }
View Full Code Here

TOP

Related Classes of org.davic.net.InvalidLocatorException

Copyright © 2018 www.massapicom. 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.