Skip to content

Commit a43cc4a

Browse files
AustinMRookephillipuniverse
authored andcommitted
BroadleafCommerce#1293 Added a String to allow for clients to specify which type of extension to use during encoding.
(cherry picked from commit 7c35644)
1 parent e6510af commit a43cc4a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/src/main/java/org/broadleafcommerce/common/sitemap/service/SiteMapServiceImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
public class SiteMapServiceImpl implements SiteMapService {
5959

6060
protected static final Log LOG = LogFactory.getLog(SiteMapServiceImpl.class);
61+
62+
protected static final String ENCODING_EXTENSION = ".gz";
6163

6264
protected Boolean gzipSiteMapFiles;
6365

@@ -115,7 +117,7 @@ public SiteMapGenerationResponse generateSiteMap() throws SiteMapException, IOEx
115117
gzipAndDeleteFiles(fileWorkArea, siteMapBuilder.getIndexedFileNames());
116118
List<String> indexFileNames = new ArrayList<String>();
117119
for (String fileName: siteMapBuilder.getIndexedFileNames()) {
118-
indexFileNames.add(fileName + ".gz");
120+
indexFileNames.add(fileName + ENCODING_EXTENSION);
119121
}
120122
smgr.setSiteMapFilePaths(indexFileNames);
121123
} else {
@@ -211,7 +213,7 @@ protected void gzipAndDeleteFiles(FileWorkArea fileWorkArea, List<String> fileNa
211213
String fileNameWithPath = FilenameUtils.normalize(fileWorkArea.getFilePathLocation() + File.separator + fileName);
212214

213215
FileInputStream fis = new FileInputStream(fileNameWithPath);
214-
FileOutputStream fos = new FileOutputStream(fileNameWithPath + ".gz");
216+
FileOutputStream fos = new FileOutputStream(fileNameWithPath + ENCODING_EXTENSION);
215217
GZIPOutputStream gzipOS = new GZIPOutputStream(fos);
216218
byte[] buffer = new byte[1024];
217219
int len;

0 commit comments

Comments
 (0)