Skip to content

Commit

Permalink
Fix premature changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LSmyrnaios committed Nov 28, 2024
1 parent eab42ee commit e16993d
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ public static void writeResultsToFile()

public static final AtomicInteger numOfDocFiles = new AtomicInteger(0);

public static FileData storeDocFileWithIdOrOriginalFileName(HttpURLConnection conn, String docUrl, String id, int contentSize) throws FileNotRetrievedException, NoSpaceLeftException
public static FileData storeDocFileWithIdOrOriginalFileName(HttpURLConnection conn, String docUrl, String id, int contentSize) throws FileNotRetrievedException
//, NoSpaceLeftException
{
FileData fileData;
if ( ArgsUtils.fileNameType.equals(ArgsUtils.fileNameTypeEnum.idName) )
Expand Down Expand Up @@ -546,12 +547,15 @@ public static synchronized FileData storeDocFileWithNumberName(HttpURLConnection
/**
* This method Returns the Document-"File" object which has the original file name as the final fileName.
* It is effectively synchronized, since it's always called from a synchronized method.
*
* @param docUrl
* @param contentDisposition
* @param contentSize
* @return
* @throws FileNotRetrievedException
*/
public static FileData getDocFileWithOriginalFileName(String docUrl, String contentDisposition, int contentSize) throws FileNotRetrievedException, NoSpaceLeftException
public static FileData getDocFileWithOriginalFileName(String docUrl, String contentDisposition, int contentSize) throws FileNotRetrievedException
//, NoSpaceLeftException
{
String docFileName = null;
boolean hasUnretrievableDocName = false;
Expand Down Expand Up @@ -612,16 +616,16 @@ public static FileData getDocFileWithOriginalFileName(String docUrl, String cont

//logger.debug("docFileName: " + docFileName);

return getDocFileAndHandleExisting(docFileName, dotFileExtension, hasUnretrievableDocName);
return getDocFileAndHandleExisting(docFileName, dotFileExtension, hasUnretrievableDocName, contentSize, ArgsUtils.storeDocFilesDir, numbersOfDuplicateDocFileNames);
}


private static final Lock fileNameLock = new ReentrantLock(true);

public static FileData getDocFileAndHandleExisting(String fileName, String dotFileExtension, boolean hasUnretrievableDocName
public static FileData getDocFileAndHandleExisting(String fileName, String dotFileExtension, boolean hasUnretrievableDocName, int contentSize, String storeFilesDir,
HashMap<String, Integer> numbersOfDuplicateFileNames
)
throws FileNotRetrievedException
, NoSpaceLeftException
throws FileNotRetrievedException //, NoSpaceLeftException
{
String saveDocFileFullPath = storeFilesDir + fileName;
if ( ! fileName.endsWith(dotFileExtension) )
Expand Down

0 comments on commit e16993d

Please sign in to comment.