Package org.apache.photark.services.album

Examples of org.apache.photark.services.album.Album


    try {
      Session session = repositoryManager.getSession();
      Node root = session.getRootNode();
      if(root.hasNode(albumName)){
        Node albumNode = root.getNode(albumName);
         Album album = JCRAlbumImpl.createAlbum(repositoryManager, albumName);
        if (albums.contains(album)) {
                    albums.remove(album);
                }
        albumNode.remove();
        session.save();
View Full Code Here


                if (album.isDirectory() && album.exists()) {
                    File[] albums = album.listFiles();
                    for(File albumFile : albums) {
                        if(! albumFile.getName().startsWith(".")) {
                            if(albumFile.isDirectory() && albumFile.exists()) {
                                Album newAlbum = new org.apache.photark.filesystem.impl.AlbumImpl();
                                newAlbum.setName(albumFile.getName());
                                newAlbum.setLocation(albumFile.getPath());
                                this.albums.add(newAlbum);
                            }                               
                        }
                    }
                }
View Full Code Here

        albums.toArray(albumArray);
        return albumArray;
    }

    public String getAlbumCover(String albumName) {
        Album albumLookup = getAlbum(albumName);

        if (albumLookup != null) {
            String[] pictures = albumLookup.getPictures();
            // this check is to avoid Exception
            if (pictures.length > 0) {
                return albumLookup.getPictures()[0];
            } else {
                logger.info("No Album Cover Picture found for album:" + albumName);
                return null;
            }
        } else {
View Full Code Here

            return null;
        }
    }

    public String[] getAlbumPictures(String albumName) {
        Album albumLookup = getAlbum(albumName);

        if (albumLookup != null) {
            return albumLookup.getPictures();
        } else {
            // FIXME: return proper not found exception
            return new String[] {};
        }
    }
View Full Code Here

            return new String[] {};
        }
    }

    private Album getAlbum(String albumName) {
        Album albumLookup = null;
        for (Album album : albums) {
            if (album.getName().equalsIgnoreCase(albumName)) {
                albumLookup = album;
                break;
            }
View Full Code Here

TOP

Related Classes of org.apache.photark.services.album.Album

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.