diff src/org/tmatesoft/hg/internal/Internals.java @ 667:fba85bc1dfb8

Refactoring: move all encoding/decoding operations into single place, EncodingHelper
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 11 Jul 2013 17:54:08 +0200
parents 46b56864b483
children b4242b7e7dfe
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Internals.java	Wed Jul 10 20:22:07 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/Internals.java	Thu Jul 11 17:54:08 2013 +0200
@@ -247,19 +247,18 @@
 	public boolean isCaseSensitiveFileSystem() {
 		return isCaseSensitiveFileSystem;
 	}
-	
-	public EncodingHelper buildFileNameEncodingHelper() {
-		return new EncodingHelper(getFilenameEncoding(), repo.getSessionContext());
-	}
-	
+
 	public boolean fncacheInUse() {
 		return (getRequiresFlags() & RequiresFile.FNCACHE) != 0;
 	}
-	
-	/*package-local*/ Charset getFilenameEncoding() {
-		return getFileEncoding(getSessionContext());
+
+	public EncodingHelper buildFileNameEncodingHelper() {
+		return new EncodingHelper(getFileEncoding(getSessionContext()), repo);
 	}
 	
+	public static EncodingHelper buildFileNameEncodingHelper(SessionContext.Source ctx) {
+		return new EncodingHelper(getFileEncoding(ctx.getSessionContext()), ctx);
+	}
 	/*package-local*/ static Charset getFileEncoding(SessionContext ctx) {
 		Object altEncoding = ctx.getConfigurationProperty(CFG_PROPERTY_FS_FILENAME_ENCODING, null);
 		Charset cs;