public static boolean isFileLocked(String filename) throws SwingObjectException {
		boolean isLocked=false;
		RandomAccessFile fos=null;
		try {
			File file = new File(filename);
			if(file.exists()) {
				fos=new RandomAccessFile(file,"rw");
			}
		} catch (FileNotFoundException e) {
			isLocked=true;
		}catch (Exception e) {
			throw new SwingObjectException("Error while checking if a file is locked",e, ErrorSeverity.SEVERE,FileHelper.class);
		}finally {
			try {
				if(fos!=null) {
					fos.close();
				}
			}catch(Exception e) {
				throw new SwingObjectException("Error while checking if a file is locked",e, ErrorSeverity.SEVERE,FileHelper.class);
			}
		}
		return isLocked;
	}