}
private String toOutputName(String inputResourcePattern) throws IOException {
assert inputResourcePattern != null;
String patternString = resolve(inputResourcePattern);
FilePattern pattern = FilePattern.compile(patternString);
if (pattern.containsVariables()) {
throw new IOException(MessageFormat.format(
"Input resource pattern contains variables (original=[{0}], expanded=[{1}])",
inputResourcePattern,
patternString));
}
StringBuilder buf = new StringBuilder();
for (Segment segment : pattern.getSegments()) {
if (buf.length() != 0) {
buf.append('/');
}
if (segment.isTraverse()) {
buf.append(WILDCARD_REPLACEMENT);