git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271250 13f79535-47bb-0310-9956-ffa450edef68master
@@ -7,10 +7,6 @@ | |||||
*/ | */ | ||||
package org.apache.aut.manifest; | package org.apache.aut.manifest; | ||||
import java.io.PrintWriter; | |||||
import java.io.IOException; | |||||
import java.util.jar.Attributes; | |||||
/** | /** | ||||
* Class to hold manifest attributes | * Class to hold manifest attributes | ||||
* | * | ||||
@@ -22,7 +22,7 @@ public final class NameScope | |||||
* not be empty, or <code>.</code>, or <code>..</code>, or contain any | * not be empty, or <code>.</code>, or <code>..</code>, or contain any | ||||
* separator characters. | * separator characters. | ||||
*/ | */ | ||||
public static final NameScope CHILD = new NameScope( "child" ); | |||||
public final static NameScope CHILD = new NameScope( "child" ); | |||||
/** | /** | ||||
* Resolve against files in the same file system as the base file. | * Resolve against files in the same file system as the base file. | ||||
@@ -39,7 +39,7 @@ public final class NameScope | |||||
* <p>A path is considered absolute if it starts with a separator character, | * <p>A path is considered absolute if it starts with a separator character, | ||||
* and relative if it does not. | * and relative if it does not. | ||||
*/ | */ | ||||
public static final NameScope FILE_SYSTEM = new NameScope( "filesystem" ); | |||||
public final static NameScope FILE_SYSTEM = new NameScope( "filesystem" ); | |||||
private String m_name; | private String m_name; | ||||
@@ -27,9 +27,10 @@ import org.apache.avalon.excalibur.i18n.Resources; | |||||
* | * | ||||
* @author Adam Murdoch | * @author Adam Murdoch | ||||
*/ | */ | ||||
public class DefaultFileSystemManager implements FileSystemManager | |||||
public class DefaultFileSystemManager | |||||
implements FileSystemManager | |||||
{ | { | ||||
private static final Resources REZ | |||||
private final static Resources REZ | |||||
= ResourceManager.getPackageResources( DefaultFileSystemManager.class ); | = ResourceManager.getPackageResources( DefaultFileSystemManager.class ); | ||||
/** The default provider. */ | /** The default provider. */ | ||||
@@ -90,7 +91,8 @@ public class DefaultFileSystemManager implements FileSystemManager | |||||
* Creates a provider instance, returns null if the provider class is | * Creates a provider instance, returns null if the provider class is | ||||
* not found. | * not found. | ||||
*/ | */ | ||||
private FileSystemProvider createProvider( final String className ) throws Exception | |||||
private FileSystemProvider createProvider( final String className ) | |||||
throws Exception | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -186,7 +188,8 @@ public class DefaultFileSystemManager implements FileSystemManager | |||||
/** | /** | ||||
* A provider context implementation. | * A provider context implementation. | ||||
*/ | */ | ||||
private final class ProviderContextImpl implements FileSystemProviderContext | |||||
private final class ProviderContextImpl | |||||
implements FileSystemProviderContext | |||||
{ | { | ||||
/** | /** | ||||
* Locates a cached file system by root URI. | * Locates a cached file system by root URI. | ||||
@@ -27,16 +27,18 @@ import org.apache.avalon.excalibur.i18n.Resources; | |||||
* | * | ||||
* @author Adam Murdoch | * @author Adam Murdoch | ||||
*/ | */ | ||||
public abstract class AbstractFileObject implements FileObject | |||||
public abstract class AbstractFileObject | |||||
implements FileObject | |||||
{ | { | ||||
private static final Resources REZ = | |||||
private final static Resources REZ = | |||||
ResourceManager.getPackageResources( AbstractFileObject.class ); | ResourceManager.getPackageResources( AbstractFileObject.class ); | ||||
private final static FileObject[] EMPTY_FILE_ARRAY = {}; | |||||
private FileName m_name; | private FileName m_name; | ||||
private AbstractFileSystem m_fs; | private AbstractFileSystem m_fs; | ||||
private DefaultFileContent m_content; | private DefaultFileContent m_content; | ||||
private static final FileObject[] EMPTY_FILE_ARRAY = {}; | |||||
// Cached info | // Cached info | ||||
private boolean m_attached; | private boolean m_attached; | ||||
@@ -17,9 +17,10 @@ import org.apache.avalon.excalibur.i18n.Resources; | |||||
* | * | ||||
* @author Adam Murdoch | * @author Adam Murdoch | ||||
*/ | */ | ||||
public abstract class AbstractFileSystemProvider implements FileSystemProvider | |||||
public abstract class AbstractFileSystemProvider | |||||
implements FileSystemProvider | |||||
{ | { | ||||
private static final Resources REZ | |||||
private final static Resources REZ | |||||
= ResourceManager.getPackageResources( AbstractFileSystemProvider.class ); | = ResourceManager.getPackageResources( AbstractFileSystemProvider.class ); | ||||
protected FileSystemProviderContext m_context; | protected FileSystemProviderContext m_context; | ||||
@@ -23,20 +23,21 @@ import org.apache.avalon.excalibur.i18n.Resources; | |||||
* | * | ||||
* @author Adam Murdoch | * @author Adam Murdoch | ||||
*/ | */ | ||||
public class DefaultFileContent implements FileContent | |||||
public class DefaultFileContent | |||||
implements FileContent | |||||
{ | { | ||||
private static final Resources REZ | |||||
= ResourceManager.getPackageResources( DefaultFileContent.class ); | |||||
private final static Resources REZ = | |||||
ResourceManager.getPackageResources( DefaultFileContent.class ); | |||||
private final static int STATE_NONE = 0; | |||||
private final static int STATE_READING = 1; | |||||
private final static int STATE_WRITING = 2; | |||||
private AbstractFileObject m_file; | private AbstractFileObject m_file; | ||||
private int _state = STATE_NONE; | private int _state = STATE_NONE; | ||||
private FileContentInputStream m_instr; | private FileContentInputStream m_instr; | ||||
private FileContentOutputStream m_outstr; | private FileContentOutputStream m_outstr; | ||||
private static final int STATE_NONE = 0; | |||||
private static final int STATE_READING = 1; | |||||
private static final int STATE_WRITING = 2; | |||||
public DefaultFileContent( AbstractFileObject file ) | public DefaultFileContent( AbstractFileObject file ) | ||||
{ | { | ||||
m_file = file; | m_file = file; | ||||
@@ -332,7 +333,8 @@ public class DefaultFileContent implements FileContent | |||||
/** | /** | ||||
* An output stream for writing content. | * An output stream for writing content. | ||||
*/ | */ | ||||
private final class FileContentOutputStream extends BufferedOutputStream | |||||
private final class FileContentOutputStream | |||||
extends BufferedOutputStream | |||||
{ | { | ||||
FileContentOutputStream( OutputStream outstr ) | FileContentOutputStream( OutputStream outstr ) | ||||
{ | { | ||||
@@ -20,8 +20,8 @@ import org.apache.avalon.excalibur.i18n.Resources; | |||||
*/ | */ | ||||
public class UriParser | public class UriParser | ||||
{ | { | ||||
private static final Resources REZ | |||||
= ResourceManager.getPackageResources( UriParser.class ); | |||||
private final static Resources REZ = | |||||
ResourceManager.getPackageResources( UriParser.class ); | |||||
/** The normalised separator to use. */ | /** The normalised separator to use. */ | ||||
private char m_separatorChar; | private char m_separatorChar; | ||||
@@ -495,16 +495,19 @@ public class UriParser | |||||
maxlen = path.length(); | maxlen = path.length(); | ||||
continue; | continue; | ||||
} | } | ||||
if( elemLen == 2 | |||||
&& path.charAt( startElem ) == '.' | |||||
&& path.charAt( startElem + 1 ) == '.' ) | |||||
if( elemLen == 2 && | |||||
path.charAt( startElem ) == '.' && | |||||
path.charAt( startElem + 1 ) == '.' ) | |||||
{ | { | ||||
// A '..' element - remove the previous element | // A '..' element - remove the previous element | ||||
if( startElem > startFirstElem ) | if( startElem > startFirstElem ) | ||||
{ | { | ||||
int pos = startElem - 2; | int pos = startElem - 2; | ||||
for( ; path.charAt( pos ) != m_separatorChar; pos-- ) | |||||
char ch = path.charAt( pos ); | |||||
while( ch != m_separatorChar ) | |||||
{ | { | ||||
pos--; | |||||
ch = path.charAt( pos ); | |||||
} | } | ||||
startElem = pos + 1; | startElem = pos + 1; | ||||
} | } | ||||