| 1 |
/* |
| 2 |
* Copyright (C) 2008 The Android Open Source Project |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
| 6 |
* You may obtain a copy of the License at |
| 7 |
* |
| 8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
* |
| 10 |
* Unless required by applicable law or agreed to in writing, software |
| 11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
* See the License for the specific language governing permissions and |
| 14 |
* limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
package com.android.io; |
| 18 |
|
| 19 |
/** |
| 20 |
* Base representation of a file system resource. |
| 21 |
* <p> |
| 22 |
* This somewhat limited interface is designed to let classes use file-system resources, without |
| 23 |
* having the manually handle either the standard Java file or the Eclipse file API.. |
| 24 |
*/ |
| 25 |
public interface IAbstractResource { |
| 26 |
|
| 27 |
/** |
| 28 |
* Returns the name of the resource. |
| 29 |
*/ |
| 30 |
String getName(); |
| 31 |
|
| 32 |
/** |
| 33 |
* Returns the OS path of the folder location (may be absolute). |
| 34 |
*/ |
| 35 |
String getOsLocation(); |
| 36 |
|
| 37 |
/** |
| 38 |
* Returns the path of the resource. |
| 39 |
*/ |
| 40 |
String getPath(); |
| 41 |
|
| 42 |
/** |
| 43 |
* Returns whether the resource actually exists. |
| 44 |
*/ |
| 45 |
boolean exists(); |
| 46 |
|
| 47 |
/** |
| 48 |
* Returns the parent folder or null if there is no parent. |
| 49 |
*/ |
| 50 |
IAbstractFolder getParentFolder(); |
| 51 |
|
| 52 |
/** |
| 53 |
* Deletes the resource. |
| 54 |
*/ |
| 55 |
boolean delete(); |
| 56 |
} |