agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/dao/RemoteFilePermissionDao.java
/**
	 * Deletes all logical file permissions for the specified username and logical file
	 * 
	 * @param username
	 * @param logicalFileId
	 * @return
	 * @throws RemoteDataException
	 */
Deletes all logical file permissions for the specified username and logical file

@param username
@param logicalFileId
@return
@throws RemoteDataException
Deletes all logical file permissions for the specified username and logical file @param username @param logicalFileId @return @throws RemoteDataException
public static void deleteByUsernameAndlogicalFileId(String username, long logicalFileId) 
	throws PermissionException
	{
		if (!ServiceUtils.isValid(username))
			throw new PermissionException("Username cannot be null");
		try
		{
			Session session = getSession();
			String hql = "DELETE FROM `remotefilepermissions` "
					+ "WHERE logical_file_id = :logicalfileid AND "
					+ "		username = :username AND"
					+ "		tenant_id = :tenantid";
			session.createSQLQuery(hql)
					.setString("username", username)
					.setLong("logicalfileid", logicalFileId)
					.setString("tenantid", TenancyHelper.getCurrentTenantId())
					.executeUpdate();
			session.flush();
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception e) {}
			throw new PermissionException(ex);
		}
		finally {
			try { HibernateUtil.commitTransaction(); } catch (Exception e) {}
		}
	}
public static void deleteByUsernameAndlogicalFileId ( String username , long logicalFileId ) throws PermissionException { if ( ! ServiceUtils . isValid ( username ) ) throw new PermissionException ( "Username cannot be null" ) ; try { Session session = getSession ( ) ; String hql = "DELETE FROM `remotefilepermissions` " + "WHERE logical_file_id = :logicalfileid AND " + "		username = :username AND" + "		tenant_id = :tenantid" ; session . createSQLQuery ( hql ) . setString ( "username" , username ) . setLong ( "logicalfileid" , logicalFileId ) . setString ( "tenantid" , TenancyHelper . getCurrentTenantId ( ) ) . executeUpdate ( ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception e ) { } throw new PermissionException ( ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception e ) { } } }
Deletes all logical file permissions for the specified username and logical file
Deletes all logical file permissions for the specified username and logical file