@ -49,7 +49,7 @@ import java.util.Set;
import org.eclipse.jgit.lib.ObjectId ;
import org.eclipse.jgit.storage.dfs.DfsObjDatabase.PackSource ;
import org.eclipse.jgit.storage.pack.PackConstants ;
import org.eclipse.jgit.storage.pack.PackExt ;
import org.eclipse.jgit.storage.pack.PackWriter ;
/ * *
@ -69,7 +69,7 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
private long lastModified ;
private Map < String , Long > sizeMap ;
private Map < PackExt , Long > sizeMap ;
private long objectCount ;
@ -98,7 +98,7 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
this . repoDesc = repoDesc ;
int dot = name . lastIndexOf ( '.' ) ;
this . packName = ( dot < 0 ) ? name : name . substring ( 0 , dot ) ;
this . sizeMap = new HashMap < String , Long > ( 5 ) ;
this . sizeMap = new HashMap < PackExt , Long > ( 5 ) ;
}
/** @return description of the repository. */
@ -111,8 +111,8 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
* the file extension
* @return name of the file .
* * /
public String getFileName ( String ext ) {
return packName + '.' + ext ;
public String getFileName ( PackExt ext ) {
return packName + '.' + ext . getExtension ( ) ;
}
/** @return the source of the pack. */
@ -153,7 +153,7 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
* be determined on first read .
* @return { @code this }
* /
public DfsPackDescription setFileSize ( String ext , long bytes ) {
public DfsPackDescription setFileSize ( PackExt ext , long bytes ) {
sizeMap . put ( ext , Long . valueOf ( Math . max ( 0 , bytes ) ) ) ;
return this ;
}
@ -163,7 +163,7 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
* the file extension .
* @return size of the file , in bytes . If 0 the file size is not yet known .
* /
public long getFileSize ( String ext ) {
public long getFileSize ( PackExt ext ) {
Long size = sizeMap . get ( ext ) ;
return size = = null ? 0 : size . longValue ( ) ;
}
@ -278,6 +278,6 @@ public class DfsPackDescription implements Comparable<DfsPackDescription> {
@Override
public String toString ( ) {
return getFileName ( PackConstants . PACK_EXT ) ;
return getFileName ( PackExt . PACK ) ;
}
}