-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathILogicalSourceLocationResolver.java
More file actions
36 lines (31 loc) · 1.37 KB
/
ILogicalSourceLocationResolver.java
File metadata and controls
36 lines (31 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*******************************************************************************
* Copyright (c) 2009-2025 CWI
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* * Jurgen J. Vinju - Jurgen.Vinju@cwi.nl - CWI
*******************************************************************************/
package org.rascalmpl.uri;
import java.io.IOException;
import io.usethesource.vallang.ISourceLocation;
/**
* A logical resolver translates locations keyed by their scheme and (optionally) their authority
* to a lower level scheme. Logical resolvers may translate to other logical resolvers, but
* most of them map directly to a physical location like file:///
*/
public interface ILogicalSourceLocationResolver {
ISourceLocation resolve(ISourceLocation input) throws IOException;
String scheme();
String authority();
/**
* Some logical resolver may collect entries from more than one location,
* hence first resolving and then calling ISourceLocationInput.list(..) won't do.
* An example is the PATH:/// resolver.
*/
default String[] resolveList(ISourceLocation input) throws IOException {
return URIResolverRegistry.getInstance().listEntries(resolve(input));
}
}