1 /* 2 * This file is part of libbluray 3 * Copyright (C) 2010 William Hahne 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library. If not, see 17 * <http://www.gnu.org/licenses/>. 18 */ 19 20 package org.dvb.io.persistent; 21 22 public class FileAccessPermissions { FileAccessPermissions(boolean readWorld, boolean writeWorld, boolean readOrganization, boolean writeOrganization, boolean readApplication, boolean writeApplication)23 public FileAccessPermissions(boolean readWorld, boolean writeWorld, 24 boolean readOrganization, boolean writeOrganization, 25 boolean readApplication, boolean writeApplication) { 26 this.readWorld = readWorld; 27 this.writeWorld = writeWorld; 28 this.readOrganization = readOrganization; 29 this.writeOrganization = writeOrganization; 30 this.readApplication = readApplication; 31 this.writeApplication = writeApplication; 32 } 33 hasReadWorldAccessRight()34 public boolean hasReadWorldAccessRight() { 35 return readWorld; 36 } 37 hasWriteWorldAccessRight()38 public boolean hasWriteWorldAccessRight() { 39 return writeWorld; 40 } 41 hasReadOrganisationAccessRight()42 public boolean hasReadOrganisationAccessRight() { 43 return readOrganization; 44 } 45 hasWriteOrganisationAccessRight()46 public boolean hasWriteOrganisationAccessRight() { 47 return writeOrganization; 48 } 49 hasReadApplicationAccessRight()50 public boolean hasReadApplicationAccessRight() { 51 return readApplication; 52 } 53 hasWriteApplicationAccessRight()54 public boolean hasWriteApplicationAccessRight() { 55 return writeApplication; 56 } 57 setPermissions(boolean ReadWorld, boolean WriteWorld, boolean ReadOrganization, boolean WriteOrganization, boolean ReadApplication, boolean WriteApplication)58 public void setPermissions(boolean ReadWorld, boolean WriteWorld, 59 boolean ReadOrganization, boolean WriteOrganization, 60 boolean ReadApplication, boolean WriteApplication) { 61 this.readWorld = ReadWorld; 62 this.writeWorld = WriteWorld; 63 this.readOrganization = ReadOrganization; 64 this.writeOrganization = WriteOrganization; 65 this.readApplication = ReadApplication; 66 this.writeApplication = WriteApplication; 67 } 68 toString()69 public String toString() { 70 return this.getClass().getName() + 71 "[rApp=" + readApplication + 72 ",wApp=" + writeApplication + 73 ",rOrg=" + readOrganization + 74 ",wOrg=" + writeOrganization + 75 ",rWorld=" + readWorld + 76 ",wWorld=" + writeWorld + "]"; 77 } 78 79 private boolean readWorld; 80 private boolean writeWorld; 81 private boolean readOrganization; 82 private boolean writeOrganization; 83 private boolean readApplication; 84 private boolean writeApplication; 85 } 86