English 中文(简体)
Fetching file and path from web using java
原标题:Fetching file and path from network using java
  • 时间:2011-11-03 07:07:41
  •  标签:
  • java
  • file-io

我需要从网络中取出一个档案,并利用《联合国公约》拯救相关档案。 我需要在特定时间从该档案中进口数据。 任何人都可以向我推荐一个样本方案,以便我至少能够从网络上查找档案并储存档案。

我正在使用一个周转申请,因此,我需要采用一个时间表进口,在某个特定时间触发进口。 较早 我正在使用当地的Jbos,但现在我需要的是,如果有人根据自己的电脑铺一条道路,则应当把道路储存在UNC格式中,以便档案在预定时间自动输入任何其他机器的数据库。 因此,我基本上需要按照联合国中心格式储存这条道路。 我在申请中使用Swam和泉水。

与此相比,还有几个问题,例如,如果fold子不能令人har惜,它会如何在特定时间进口。 除此以外,即使有共同之处,它也会储存整个道路,但我只希望能够分享这一路程的一部分。 这是我在守则中使用的:

java.net.InetAddress i = java.net.InetAddress.getLocalHost();
System.out.println(i);                  // name and IP address
System.out.println(i.getHostName());    // name
System.out.println(i.getHostAddress()); // IP address only

StringBuffer s = new StringBuffer(filePath);
StringBuffer AfterRemoval=s.delete(0,1);

String finalFilePath;
StringBuffer sb = new StringBuffer(40);
finalFilePath = sb.append(i.getHostName()).append(AfterRemoval).toString();
System.out.println(finalFilePath); 
最佳回答

No problem. The UNC convention is without drive letters (C:, D:) in the format

www.un.org/Depts/DGACM/index_spanish.htm CompUTER DIR FILE。

在贾瓦,案卷足以构成新的卷宗(“//COMPUTER/DIR/DIR/FILE”)或“COMIR DIR FILE”。 (我在斜坡上增加外围空间。)

文档(getPath)将总是产生反弹(Windows)。

For the computer name you can use getHostName(), see: http://www.rgagnon.com/javadetails/java-0390.html

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签