|
|
|
аплет и SecurityException
|
|||
|---|---|---|---|
|
#18+
Скажите, гуру, что-нибудь: http://forum.vingrad.ru/index.php?showtopic=20734] ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.04.2004, 13:38:19 |
|
||
|
аплет и SecurityException
|
|||
|---|---|---|---|
|
#18+
Была такая проблема, решил. Если апплет и подгружаемые им файлы находяться на одном хосте, то никаких настроек у клиента (типа изменить .java.policy) делать не надо. Все нормально загружаеться и распаковываеться. Посмотрю вечером исходники, выложу ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.04.2004, 14:11:34 |
|
||
|
аплет и SecurityException
|
|||
|---|---|---|---|
|
#18+
protected Object load(String nameArhive,String nameEntry){//loadObject Object object=null; try{ URLConnection urlConnection = new URL(m_applet.getDocumentBase(),nameArhive).openConnection(); urlConnection.setDoInput(true); urlConnection.setDoOutput(false); urlConnection.connect(); int readSource = 0; int read; int i=0; int j=0; InputStream is = urlConnection.getInputStream(); byte[] tempSource; byte[] source = new byte[2048]; do{ if(readSource+(read=is.available())>source.length){ tempSource = source; source = new byte[source.length*2]; System.arraycopy(tempSource,0,source,0,readSource); } readSource+=is.read(source,readSource,source.length-readSource); }while(read>0); urlConnection.getInputStream().close(); ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(source,0,readSource)); ZipEntry zipEntry; for(;;){ if((zipEntry = zipInputStream.getNextEntry())==null) break; if(zipEntry.getName().equals(nameEntry)){ object=(new ObjectInputStream(zipInputStream)).readObject(); zipInputStream.close(); break; } zipInputStream.closeEntry(); } }catch(Exception e){ e.printStackTrace(); } return object; } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.04.2004, 20:29:12 |
|
||
|
аплет и SecurityException
|
|||
|---|---|---|---|
|
#18+
Вышеприведенное проверено в IE, Netcape, Opera ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.04.2004, 20:34:34 |
|
||
|
аплет и SecurityException
|
|||
|---|---|---|---|
|
#18+
Спасибо, Edgiz! Я, вообще говоря, делал так: Сейчас в принципе это тоже рабочая версия. Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Наверное так делать нельзя??? У меня такое ощущение, что в этом случае по сети будут идти уже разархивированные данные? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.04.2004, 07:30:13 |
|
||
|
аплет и SecurityException
|
|||
|---|---|---|---|
|
#18+
Да можно, в любом случае сначала скачиваеться архив, потом уже распаковываеться в апплете. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.04.2004, 09:40:42 |
|
||
|
аплет и SecurityException
|
|||
|---|---|---|---|
|
#18+
При использовании кода while((count = (zipInputStream.read(data, 0, BUFFER)))!= -1){ dest.write(data, 0, count); } получаю java.io.EOFException: Unexpected end of ZLIB input stream at java.util.zip.InflaterInputStream.fill(Unknown Source) at java.util.zip.InflaterInputStream.read(Unknown Source) at java.util.zip.ZipInputStream.read(Unknown Source) at ru.my.megapack.JDBCHelper.getImages(JDBCHelper.java:254) at ru.my.megapack.Service.run(Service.java:12) at ru.my.megapack.HelpRunner.main(HelpRunner.java:9) в случае, когда присылаю более одного файла в папке. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.06.2012, 16:24:11 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=32468453&tid=2131638]: |
0ms |
get settings: |
13ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
51ms |
get topic data: |
16ms |
get forum data: |
4ms |
get page messages: |
65ms |
get tp. blocked users: |
2ms |
| others: | 318ms |
| total: | 489ms |

| 0 / 0 |
