106 lines
3.3 KiB
Java
106 lines
3.3 KiB
Java
package androidx.documentfile.provider;
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
import android.provider.DocumentsContract;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.RequiresApi;
|
|
@RequiresApi(19)
|
|
/* loaded from: classes.dex */
|
|
public class SingleDocumentFile extends DocumentFile {
|
|
private Context mContext;
|
|
private Uri mUri;
|
|
|
|
public SingleDocumentFile(@Nullable DocumentFile documentFile, Context context, Uri uri) {
|
|
super(documentFile);
|
|
this.mContext = context;
|
|
this.mUri = uri;
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean canRead() {
|
|
return DocumentsContractApi19.canRead(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean canWrite() {
|
|
return DocumentsContractApi19.canWrite(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public DocumentFile createDirectory(String str) {
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public DocumentFile createFile(String str, String str2) {
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean delete() {
|
|
try {
|
|
return DocumentsContract.deleteDocument(this.mContext.getContentResolver(), this.mUri);
|
|
} catch (Exception unused) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean exists() {
|
|
return DocumentsContractApi19.exists(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
@Nullable
|
|
public String getName() {
|
|
return DocumentsContractApi19.getName(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
@Nullable
|
|
public String getType() {
|
|
return DocumentsContractApi19.getType(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public Uri getUri() {
|
|
return this.mUri;
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean isDirectory() {
|
|
return DocumentsContractApi19.isDirectory(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean isFile() {
|
|
return DocumentsContractApi19.isFile(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean isVirtual() {
|
|
return DocumentsContractApi19.isVirtual(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public long lastModified() {
|
|
return DocumentsContractApi19.lastModified(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public long length() {
|
|
return DocumentsContractApi19.length(this.mContext, this.mUri);
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public DocumentFile[] listFiles() {
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
|
|
@Override // androidx.documentfile.provider.DocumentFile
|
|
public boolean renameTo(String str) {
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
}
|