Lines Matching refs:self

32     public static boolean isDocumentUri(Context context, Uri self) {
33 return DocumentsContract.isDocumentUri(context, self);
36 public static String getName(Context context, Uri self) {
37 return queryForString(context, self, DocumentsContract.Document.COLUMN_DISPLAY_NAME, null);
40 private static String getRawType(Context context, Uri self) {
41 return queryForString(context, self, DocumentsContract.Document.COLUMN_MIME_TYPE, null);
44 public static String getType(Context context, Uri self) {
45 final String rawType = getRawType(context, self);
53 public static boolean isDirectory(Context context, Uri self) {
54 return DocumentsContract.Document.MIME_TYPE_DIR.equals(getRawType(context, self));
57 public static boolean isFile(Context context, Uri self) {
58 final String type = getRawType(context, self);
66 public static long lastModified(Context context, Uri self) {
67 return queryForLong(context, self, DocumentsContract.Document.COLUMN_LAST_MODIFIED, 0);
70 public static long length(Context context, Uri self) {
71 return queryForLong(context, self, DocumentsContract.Document.COLUMN_SIZE, 0);
74 public static boolean canRead(Context context, Uri self) {
76 if (context.checkCallingOrSelfUriPermission(self, Intent.FLAG_GRANT_READ_URI_PERMISSION)
82 if (TextUtils.isEmpty(getRawType(context, self))) {
89 public static boolean canWrite(Context context, Uri self) {
91 if (context.checkCallingOrSelfUriPermission(self, Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
96 final String type = getRawType(context, self);
97 final int flags = queryForInt(context, self, DocumentsContract.Document.COLUMN_FLAGS, 0);
122 public static boolean delete(Context context, Uri self) {
123 return DocumentsContract.deleteDocument(context.getContentResolver(), self);
126 public static boolean exists(Context context, Uri self) {
131 c = resolver.query(self, new String[] {
142 private static String queryForString(Context context, Uri self, String column,
148 c = resolver.query(self, new String[] { column }, null, null, null);
162 private static int queryForInt(Context context, Uri self, String column,
164 return (int) queryForLong(context, self, column, defaultValue);
167 private static long queryForLong(Context context, Uri self, String column,
173 c = resolver.query(self, new String[] { column }, null, null, null);