LEFT | RIGHT |
1 /* | 1 /* |
2 * Licensed to the Apache Software Foundation (ASF) under one | 2 * Licensed to the Apache Software Foundation (ASF) under one |
3 * or more contributor license agreements. See the NOTICE file | 3 * or more contributor license agreements. See the NOTICE file |
4 * distributed with this work for additional information | 4 * distributed with this work for additional information |
5 * regarding copyright ownership. The ASF licenses this file | 5 * regarding copyright ownership. The ASF licenses this file |
6 * to you under the Apache License, Version 2.0 (the | 6 * to you under the Apache License, Version 2.0 (the |
7 * "License"); you may not use this file except in compliance | 7 * "License"); you may not use this file except in compliance |
8 * with the License. You may obtain a copy of the License at | 8 * with the License. You may obtain a copy of the License at |
9 * | 9 * |
10 * http://www.apache.org/licenses/LICENSE-2.0 | 10 * http://www.apache.org/licenses/LICENSE-2.0 |
11 * | 11 * |
12 * Unless required by applicable law or agreed to in writing, | 12 * Unless required by applicable law or agreed to in writing, |
13 * software distributed under the License is distributed on an | 13 * software distributed under the License is distributed on an |
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15 * KIND, either express or implied. See the License for the | 15 * KIND, either express or implied. See the License for the |
16 * specific language governing permissions and limitations | 16 * specific language governing permissions and limitations |
17 * under the License. | 17 * under the License. |
18 */ | 18 */ |
19 package org.apache.sling.api.resource; | 19 package org.apache.sling.api.resource; |
20 | 20 |
21 | |
22 /** | 21 /** |
23 * Simple helper class representing nonexisting resources. | 22 * Simple helper class representing nonexisting resources. |
24 */ | 23 */ |
25 public final class NonExistingResource extends SyntheticResource { | 24 public class NonExistingResource extends SyntheticResource { |
26 | 25 |
27 public NonExistingResource(ResourceResolver resourceResolver, | 26 public NonExistingResource(ResourceResolver resourceResolver, |
28 String resourceURI, String resourceType) { | 27 String resourceURI) { |
29 super(resourceResolver, resourceURI, resourceType==null?RESOURCE_TYPE_NO
N_EXISTING:resourceType); | 28 super(resourceResolver, resourceURI, RESOURCE_TYPE_NON_EXISTING); |
30 } | 29 } |
31 | 30 |
32 public final String getResourceType() { | 31 public String getResourceType() { |
33 // overwrite to prevent overwriting of this method in extensions of | 32 // overwrite to prevent overwriting of this method in extensions of |
34 // this class because the specific resource type is the marker of a | 33 // this class because the specific resource type is the marker of a |
35 // NonExistingResource | 34 // NonExistingResource |
36 return RESOURCE_TYPE_NON_EXISTING; | 35 return RESOURCE_TYPE_NON_EXISTING; |
37 } | 36 } |
38 | 37 |
39 public String toString() { | 38 public String toString() { |
40 // overwrite to only list the class name and path, type is irrelevant | 39 // overwrite to only list the class name and path, type is irrelevant |
41 return getClass().getSimpleName() + ", path=" + getPath(); | 40 return getClass().getSimpleName() + ", path=" + getPath(); |
42 } | 41 } |
43 } | 42 } |
LEFT | RIGHT |