новенькое

This commit is contained in:
2025-04-21 21:57:19 +05:00
parent 24305015aa
commit 27a65d38b7
4 changed files with 9 additions and 10 deletions

View File

@ -5,4 +5,4 @@ do.jlink=false
javac.debug=true
javadoc.preview=true
jlink.strip=false
user.properties.file=C:\\Users\\ivanov.i\\AppData\\Roaming\\NetBeans\\20\\build.properties
user.properties.file=C:\\Users\\ivanov.i\\AppData\\Roaming\\NetBeans\\23\\build.properties

View File

@ -3,8 +3,7 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/O:/projects/Workspace_Java/GettextDB/src/tools/Download2.java</file>
<file>file:/O:/projects/Workspace_Java/GettextDB/src/potoxml/FileFinder.java</file>
<file>file:/O:/projects/Workspace_Java/GettextDB/src/potoxml/AssemblyJFrame.java</file>
<file>file:/O:/projects/Workspace_Java/GettextDB/src/potoxml/NewJFrame.java</file>
</group>
</open-files>

View File

@ -201,7 +201,7 @@ public class FileFinder
throw new Exception("Ошибка: указанный путь не существует");
}
//если задано регулярное выражение, создаем Pattern
if (!mask.equals(""))
if (!mask.isEmpty())
{
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.
if (!fileName.equals(""))
if (!fileName.isEmpty())
{
file = new RandomAccessFile(fileName, "rw");
file.seek(downloaded);
}
if (fileName.equals("")) //фаил не задан сохраняем в буфер
if (fileName.isEmpty()) //фаил не задан сохраняем в буфер
{
this.buffer = new byte[size];
}
@ -162,7 +162,7 @@ public class Download2 extends Observable implements Runnable
stream = connection.getInputStream();
while (status == DOWNLOADING)
{
if (!fileName.equals("")) //если сохраняем в фаил
if (!fileName.isEmpty()) //если сохраняем в фаил
{
byte buffer[];
if (size - downloaded > MAX_BUFFER_SIZE)
@ -180,7 +180,7 @@ public class Download2 extends Observable implements Runnable
file.write(buffer, 0, read);
downloaded += read;
}
if (fileName.equals("")) //если сохраняем в буфер
if (fileName.isEmpty()) //если сохраняем в буфер
{
byte buffer[];
if (size - downloaded > MAX_BUFFER_SIZE)
@ -244,11 +244,11 @@ public class Download2 extends Observable implements Runnable
*/
public DataInputStream getData()
{
if (fileName.equals("")) //если сохраняем в буфер
if (fileName.isEmpty()) //если сохраняем в буфер
{
return new DataInputStream(new BufferedInputStream(new ByteArrayInputStream(buffer)));
}else
if (!fileName.equals("")) //если сохраняем в буфер
if (!fileName.isEmpty()) //если сохраняем в буфер
{
try
{