public void setFile(File file) throws InvalidAttributesException, CannotReadException, IOException, TagException, ReadOnlyFileException, InvalidAudioFrameException{ if(!file.exists()) { throw new InvalidAttributesException("Song file doesnt exist:"+file.getAbsolutePath()); } this.file=file; if(setTag(AudioFileIO.read(file).getTag())) { reloadAttributesFromFile(); } } protected boolean setTag(Tag t) {
throw new InvalidAttributesException( lnsae.getMessage() );
private void findDataStoreWriter() throws InvalidAttributesException { if (getDataStoreType().equals(DataStoreType.MONGO)) { writer = new MongoWriter(); } else if (getDataStoreType().equals(DataStoreType.ES)) { writer = new ESWriter(); } else if (getDataStoreType().equals(DataStoreType.COUCH)) { writer = new CouchWriter(); } else { throw new InvalidAttributesException("The requested datastore support is not available !."); } }
/** * @see javax.naming.directory.DirContext#modifyAttributes( * javax.naming.Name, javax.naming.directory.ModificationItem[]) */ public void modifyAttributes( Name name, ModificationItem[] mods ) throws NamingException { List<Modification> newMods; try { newMods = ServerEntryUtils .toServerModification( mods, getDirectoryService().getSchemaManager() ); } catch ( LdapException le ) { throw new InvalidAttributesException( le.getMessage() ); } try { doModifyOperation( buildTarget( JndiUtils.fromName( name ) ), newMods ); } catch ( Exception e ) { JndiUtils.wrap( e ); } }
/** * @see javax.naming.directory.DirContext#modifyAttributes( * javax.naming.Name, javax.naming.directory.ModificationItem[]) * * @param name The entry to modify * @param mods The modifications to apply * @throws NamingException If the modify operation failed */ public void modifyAttributes( Name name, List<ModificationItem> mods ) throws NamingException { List<Modification> newMods; try { newMods = ServerEntryUtils .convertToServerModification( mods, getDirectoryService().getSchemaManager() ); } catch ( LdapException le ) { throw new InvalidAttributesException( le.getMessage() ); } try { doModifyOperation( buildTarget( JndiUtils.fromName( name ) ), newMods ); } catch ( Exception e ) { JndiUtils.wrap( e ); } }
throw new InvalidAttributesException( liate.getMessage() ); throw new InvalidAttributesException( le.getMessage() ); throw new InvalidAttributesException( le.getMessage() );
assertThat( LdapUtils.convertLdapException( new javax.naming.directory.InvalidAttributesException()) .getClass()).isEqualTo( org.springframework.ldap.InvalidAttributesException.class);