# Conflicts:
#	nbproject/private/private.properties
#	nbproject/private/private.xml
This commit is contained in:
2025-04-21 22:01:08 +05:00
2 changed files with 7 additions and 7 deletions

View File

@ -201,7 +201,7 @@ public class FileFinder
throw new Exception("Ошибка: указанный путь не существует"); throw new Exception("Ошибка: указанный путь не существует");
} }
//если задано регулярное выражение, создаем Pattern //если задано регулярное выражение, создаем Pattern
if (!mask.equals("")) if (!mask.isEmpty())
{ {
p = Pattern.compile(mask, Pattern.CASE_INSENSITIVE | Pattern.COMMENTS); //Pattern.UNIcomment_CASE p = Pattern.compile(mask, Pattern.CASE_INSENSITIVE | Pattern.COMMENTS); //Pattern.UNIcomment_CASE
} }

View File

@ -149,12 +149,12 @@ public class Download2 extends Observable implements Runnable
} }
// Open file and seek to the end of it. // Open file and seek to the end of it.
if (!fileName.equals("")) if (!fileName.isEmpty())
{ {
file = new RandomAccessFile(fileName, "rw"); file = new RandomAccessFile(fileName, "rw");
file.seek(downloaded); file.seek(downloaded);
} }
if (fileName.equals("")) //фаил не задан сохраняем в буфер if (fileName.isEmpty()) //фаил не задан сохраняем в буфер
{ {
this.buffer = new byte[size]; this.buffer = new byte[size];
} }
@ -162,7 +162,7 @@ public class Download2 extends Observable implements Runnable
stream = connection.getInputStream(); stream = connection.getInputStream();
while (status == DOWNLOADING) while (status == DOWNLOADING)
{ {
if (!fileName.equals("")) //если сохраняем в фаил if (!fileName.isEmpty()) //если сохраняем в фаил
{ {
byte buffer[]; byte buffer[];
if (size - downloaded > MAX_BUFFER_SIZE) if (size - downloaded > MAX_BUFFER_SIZE)
@ -180,7 +180,7 @@ public class Download2 extends Observable implements Runnable
file.write(buffer, 0, read); file.write(buffer, 0, read);
downloaded += read; downloaded += read;
} }
if (fileName.equals("")) //если сохраняем в буфер if (fileName.isEmpty()) //если сохраняем в буфер
{ {
byte buffer[]; byte buffer[];
if (size - downloaded > MAX_BUFFER_SIZE) if (size - downloaded > MAX_BUFFER_SIZE)
@ -244,11 +244,11 @@ public class Download2 extends Observable implements Runnable
*/ */
public DataInputStream getData() public DataInputStream getData()
{ {
if (fileName.equals("")) //если сохраняем в буфер if (fileName.isEmpty()) //если сохраняем в буфер
{ {
return new DataInputStream(new BufferedInputStream(new ByteArrayInputStream(buffer))); return new DataInputStream(new BufferedInputStream(new ByteArrayInputStream(buffer)));
}else }else
if (!fileName.equals("")) //если сохраняем в буфер if (!fileName.isEmpty()) //если сохраняем в буфер
{ {
try try
{ {