Package java.util

Examples of java.util.SortedSet.first()


            existingArtifacts = new TreeSet();
        }

        // if we have exactly one artifact loaded use its' version
        if (existingArtifacts.size() == 1) {
            return (Artifact) existingArtifacts.first();
        }


        // if we have no existing loaded artifacts grab the highest version from the repository
        if (existingArtifacts.size() == 0) {
View Full Code Here


            ListableRepository repo = repos[i];
            // if the artifact is not fully resolved then try to resolve it
            if (!artifact.isResolved()) {
                SortedSet results = repo.list(artifact);
                if (!results.isEmpty()) {
                    artifact = (org.apache.geronimo.kernel.repository.Artifact) results.first();
                }
            }
            File url = repo.getLocation(artifact);
            if (url != null) {
                if (url.exists() && url.canRead() && !url.isDirectory()) {
View Full Code Here

       
        for (ListableRepository repository : repositories) {
            SortedSet artifactSet = repository.list(artifactQuery);
            // if we have exactly one artifact found
            if (artifactSet.size() == 1) {
                file = repository.getLocation((Artifact) artifactSet.first());
                return file.getAbsoluteFile().toURL();
            } else if (artifactSet.size() > 1) {// if we have more than 1 artifacts found use the latest one.
                file = repository.getLocation((Artifact) artifactSet.last());
                return file.getAbsoluteFile().toURL();
            }
View Full Code Here

            ListableRepository repo = repos[i];
            // if the artifact is not fully resolved then try to resolve it
            if (!artifact.isResolved()) {
                SortedSet results = repo.list(artifact);
                if (!results.isEmpty()) {
                    artifact = (org.apache.geronimo.kernel.repository.Artifact) results.first();
                }
            }
            File url = repo.getLocation(artifact);
            if (url != null) {
                if (url.exists() && url.canRead() && !url.isDirectory()) {
View Full Code Here

            existingArtifacts = new TreeSet();
        }

        // if we have exactly one artifact loaded use its' version
        if (existingArtifacts.size() == 1) {
            return (Artifact) existingArtifacts.first();
        }


        // if we have no existing loaded artifacts grab the highest version from the repository
        if (existingArtifacts.size() == 0) {
View Full Code Here

            existingArtifacts = new TreeSet();
        }

        // if we have exactly one artifact loaded use its' version
        if (existingArtifacts.size() == 1) {
            return (Artifact) existingArtifacts.first();
        }


        // if we have no existing loaded artifacts grab the highest version from the repository
        if (existingArtifacts.size() == 0) {
View Full Code Here

            ListableRepository repo = repos[i];
            // if the artifact is not fully resolved then try to resolve it
            if (!artifact.isResolved()) {
                SortedSet results = repo.list(artifact);
                if (!results.isEmpty()) {
                    artifact = (org.apache.geronimo.kernel.repository.Artifact) results.first();
                }
            }
            File url = repo.getLocation(artifact);
            if (url != null) {
                if (url.exists() && url.canRead() && !url.isDirectory()) {
View Full Code Here

            existingArtifacts = new TreeSet();
        }

        // if we have exactly one artifact loaded use its' version
        if (existingArtifacts.size() == 1) {
            return (Artifact) existingArtifacts.first();
        }

        //see if there is an explicit resolution for this artifact.
        Artifact resolved = (Artifact) explicitResolution.get(working);
        if (resolved != null) {
View Full Code Here

                            m = pendingMarks.headSet(overflowLoc);
                            if (m != null && m.size() > 0) {
                                logger.trace("Relocating " + m.size() + " records");
                                int nbRecord = 0;
                                while (m.size() > 0) {
                                    RecordLocation loc = (RecordLocation)m.first();
                                    Packet packet = journal.read(loc);
                                    RecordLocation newLoc = journal.write(packet, false);
                                    ObjectInputStream ois = new ObjectInputStream(
                                            new ByteArrayInputStream(packet.sliceAsBytes()));
                                    ois.readByte();
View Full Code Here

    }

    public InterfaceDefinedMethodTestCase() {
        SortedSet ss = new TreeSet();
        ss.add("foo"); // Warning, add is in super interface
        ss.first(); // Ok, first is in SortedSet

        try {
            Set s = ss;
            s.add("bar"); // Ok, add is in Set
            throw new NullPointerException("fake");
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.