/** * calculate the absolute store path for this user. * * @param settings {@link MDOMessicSettings} settings to get the base store path * @return String the absolute, full path, to store resources for this user */ public String calculateAbsolutePath( MDOMessicSettings settings ) { String path = settings.getGenericBaseStorePath() + File.separatorChar + this.getLogin(); return path; }
public String calculateAbsolutePath( MDOMessicSettings settings ) { String basePath = this.getAuthor().calculateAbsolutePath( settings ); String result = basePath + File.separatorChar + getLocation(); return result; }
public String calculateAbsolutePath( MDOMessicSettings settings ) { String basePath = getOwner().calculateAbsolutePath( settings ); String result = basePath + File.separatorChar + getLocation(); return result; }
/** * Constructor copy * * @param mdoSettings */ public MessicSettings( MDOMessicSettings mdoSettings ) { this.illegalCharacterReplacement = mdoSettings.getIllegalCharacterReplacement(); this.allowUserCreation = mdoSettings.isAllowUserCreation(); this.allowDLNA = mdoSettings.isAllowDLNA(); this.allowDiscovering = mdoSettings.isAllowMessicDiscovering(); this.messicServerName = mdoSettings.getMessicServerName(); }
public void resetPassword( Long sid ) { MDOUser mdoUserToReset = daoUser.getUserById( sid ); mdoUserToReset.setPassword( "123456" ); daoUser.saveUser( mdoUserToReset, true, mdoUserToReset.getPassword() ); }
/** * Return the absolute (relative from author folder) location to this resource * * @param albumPath {@link String} path of the album (resources are supposed to be under the album folder) * @param oldVolumes int old amount of volumes for the album * @return String path */ public String calculateAbsolutePath( String albumPath, int oldVolumes ) { return albumPath + calculateVolumePath( oldVolumes, getVolume() ) + File.separatorChar + getLocation(); }
@Transactional public MDOAuthor getAuthor( Long authorSid ) { MDOAuthor author = this.daoauthor.get( authorSid ); if ( author.getOwner().getAllowDLNA() ) { return author; } else { return null; } }
@Override @Transactional public void setNullGenre( MDOGenre genre ) { // ((a.owner.login = :userName) AND ( Query query = entityManager.createQuery( "UPDATE MDOAlbum a set a.genre = null WHERE a.owner.sid= :userSid AND a.genre.sid = :genreSid" ); // query.setParameter( "userName", genre.getOwner().getLogin() ); query.setParameter( "genreSid", genre.getSid() ); query.setParameter( "userSid", genre.getOwner().getSid() ); query.executeUpdate(); }
/** * Return the absolute (relative from author folder) location to this resource * * @param settings {@link MDOMessicSettings} settings from messic * @return String path */ public String calculateAbsolutePath( MDOMessicSettings settings ) { String albumPath = getAlbum().calculateAbsolutePath( settings ); return calculateAbsolutePath( albumPath ); }
/** * Function to calculate the volume path for the album resources, ie: /vol01 * * @return {@link String} the path to the volume */ public String calculateVolumePath() { return calculateVolumePath( getAlbum().getVolumes() ); }
/** * Check if DLNA service is allowed by Messic configuration * * @return boolean */ public boolean isGenericAllowed() { return this.daoSettings.getSettings().isAllowDLNA(); }
/** * Return the messic server name * @return */ public String getMessicServerName() { return daoSettings.getSettings().getMessicServerName(); }
/** * Return the absolute (relative from author folder) location to this resource * * @param albumPath {@link String} path of the album (resources are supposed to be under the album folder) * @return String path */ public String calculateAbsolutePath( String albumPath ) { return albumPath + calculateVolumePath() + File.separatorChar + getLocation(); }
@Transactional public MDOAlbum getAlbum( Long albumSid ) { MDOAlbum album = this.daoalbum.get( albumSid ); if ( album.getOwner().getAllowDLNA() ) { return album; } else { return null; } }
public MDOAlbumResource getCover() { List<MDOArtwork> artworks = getArtworks(); if ( artworks != null ) { for ( int i = 0; i < artworks.size(); i++ ) { MDOArtwork artwork = artworks.get( i ); if ( artwork.isCover() ) { return artwork; } } } return null; }
/** * @return the versionUpdatedNotified */ public boolean isVersionUpdatedNotified() { if ( this.versionUpdatedNotified == null ) { setVersionUpdatedNotified( false ); } return versionUpdatedNotified; }
/** * Obtain the path to the temporal folder for uploaded resources * * @param settings {@link MDOMessicSettings} settings for messic * @param albumCode {@link String} code for the album to upload * @return {@link String} temporal path for uploaded */ public String calculateTmpPath( MDOMessicSettings settings, String albumCode ) { String basePath = calculateAbsolutePath( settings ); basePath = basePath + File.separatorChar + Util.TEMPORAL_FOLDER + File.separatorChar + albumCode; return basePath; }
/** * Function to calculate the volume path for the album resources, ie: /vol01 * * @return {@link String} the path to the volume */ public String calculateVolumePath( int albumVolumes ) { Integer resourceVolume = getVolume(); String volumePath = ( albumVolumes > 1 ? "" + File.separatorChar + VOLUME_FOLDER_PRENAME + Util.leftZeroPadding( ( resourceVolume > 0 ? resourceVolume : 1 ), 2 ) : "" ); return volumePath; }