tokenpocket官网app下载地址|fsdfsf

作者: tokenpocket官网app下载地址
2024-03-07 18:48:35

FSDFSF - 彭于晏 - 专辑 - 网易云音乐

FSDFSF - 彭于晏 - 专辑 - 网易云音乐

 

 

FSDFSF

歌手:彭于晏

发行时间:2021-11-14

播放

收藏

分享

下载

评论

专辑介绍:

.....................

生成外链播放器

包含歌曲列表1首歌

加载中...

DJ ÖtzSexyAE(七岁被迫卖身 remix)

[{"duration":347459,"fee":0,"ftype":0,"score":10.0,"copyrightId":0,"mvid":0,"transNames":null,"no":1,"commentThreadId":"R_SO_4_1894856837","publishTime":0,"type":0,"status":1,"privilege":{"id":1894856837,"fee":0,"payed":0,"st":0,"pl":320000,"dl":999000,"sp":7,"cp":1,"subp":1,"cs":false,"maxbr":999000,"fl":320000,"toast":false,"flag":1,"preSell":false,"playMaxbr":999000,"downloadMaxbr":999000,"maxBrLevel":"lossless","playMaxBrLevel":"lossless","downloadMaxBrLevel":"lossless","plLevel":"exhigh","dlLevel":"lossless","flLevel":"exhigh","rscl":null,"freeTrialPrivilege":{"resConsumable":false,"userConsumable":false,"listenType":null,"cannotListenReason":null,"playReason":null},"rightSource":0,"chargeInfoList":[{"rate":128000,"chargeUrl":null,"chargeMessage":null,"chargeType":0},{"rate":192000,"chargeUrl":null,"chargeMessage":null,"chargeType":0},{"rate":320000,"chargeUrl":null,"chargeMessage":null,"chargeType":0},{"rate":999000,"chargeUrl":null,"chargeMessage":null,"chargeType":1}]},"djid":0,"album":{"id":136106313,"name":"FSDFSF","picUrl":"http://p2.music.126.net/6kVXcW0WhYT9VG1eQDgXLA==/109951166619923151.jpg","pic_str":"109951166619923151","pic":109951166619923151},"artists":[{"id":50495308,"name":"彭于晏"}],"alias":[],"name":"DJ ÖtzSexyAE(七岁被迫卖身 remix)","id":"1894856837"}]

热门专辑

全部>

Djesse Vol. 4

2024-03-01

日与夜,跟自己说晚安

2024-03-01

岛与黎明

2024-02-25

ZUTOMAYO - 2024 中国特别版

2024-02-14

ANOTHER SIDE……JOEY · MY SECRET · LIVE (Live)

2024-02-06

网易云音乐多端下载

iPhone

PC

Android

同步歌单,随时畅听好音乐

用户wiki

补充或修改专辑资料

用户wiki任务中心

音乐开放平台

云村交易所

Amped Studio

X StudioAI歌手

用户认证

音乐交易平台

云推歌

赞赏

服务条款|

隐私政策|

儿童隐私政策|

版权投诉|

投资者关系|

广告合作

|

联系我们

廉正举报

不良信息举报邮箱: 51jubao@service.netease.com

客服热线:95163298

互联网宗教信息服务许可证:浙(2022)0000120

增值电信业务经营许可证:浙B2-20150198

粤B2-20090191-18  工业和信息化部备案管理系统网站

网易公司版权所有©1997-2024杭州乐读科技有限公司运营:浙网文[2021] 1186-054号

浙公网安备 33010802013307号

回到顶部

{if degrade}

手机号登录

注 册

微信登录

QQ登录

微博登录

网易邮箱账号登录

同意

《服务条款》

《隐私政策》

《儿童隐私政策》

{else}

手机号登录

注 册

微信登录

QQ登录

微博登录

网易邮箱账号登录

同意

《服务条款》

《隐私政策》

《儿童隐私政策》

扫码登录

二维码已失效

点击刷新

使用 网易云音乐APP 扫码登录

扫描成功

请在手机上确认登录

选择其他登录模式

{/if}

忘记密码?

短信登录

自动登录

获取验证码

密码登录

自动登录

登 录

<  其他登录方式

没有账号?免费注册  >

自动登录

忘记密码?

登 录

<  其他登录方式

{list suggests as item}

${item|escape}

{/list}

手机号:

密码:

密码不能包含空格

包含字母、数字、符号中至少两种

密码长度为8-20位

下一步

<  返回登录

云音乐将不再支持 腾讯微博 登录方式,请绑定手机号,以免后续无法使用该账号

你的手机号:+ 

为了安全,我们会给你发送短信验证码

验证码:

<  返回登录

云音乐将不再支持 腾讯微博 登录方式,请绑定手机号,以免后续无法使用该账号

你的手机号:+ 

为了安全,我们会给你发送短信验证码

输入要解绑的完整手机号,用于验证您的身份

下一步

<  返回登录

跳过  >

获取验证码

获取验证码

取一个昵称,让大家记住你

完成注册,开启云音乐

取一个昵称,让大家记住你

完成注册,开启云音乐

云音乐将不再支持 腾讯微博 登录方式,设置登录密码,以后可以使用手机号登录

你的手机号:+ 

设置密码后,可以直接用该手机号+密码登录

密码不能包含空格

包含字母、数字、符号中至少两种

密码长度为8-20位

跳过  >

如果你不是机器人输入验证码一定没问题!

账号或密码错误

确 定

取消

+86

{list countries as x}

${x.zh}

+${x.code}

{/list}

由于你在非受信任的设备上登录,需要进行短信验证()

通过短信验证身份

{list data as x}${x.t}{/list}

歌单名:

错误提示

可通过“收藏”将音乐添加到新歌单中

新 建

取 消

评论共0条评论

◆◆

后面还有0条评论,查看更多>

收起

评论 ()

{list beg..end as y}

{var x=xlist[y]}

{if !!x}

${escape(x.user.nickname)}

{if x.user.avatarDetail && x.user.avatarDetail.identityIconUrl}

{/if}

{if x.user.vipRights}

{if x.user.vipRights.redplus && x.user.vipRights.redplus.vipCode === 300 && x.user.vipRights.redplus.rights && x.user.vipRights.redplus.iconUrl}

{elseif x.user.vipRights.associator && x.user.vipRights.associator.rights && x.user.vipRights.redVipLevel}

{if x.user.vipRights.associator.iconUrl}

{elseif x.user.vipRights.redVipLevel == 1}

{if useNewVipIcon}

{else}

{/if}

{elseif x.user.vipRights.redVipLevel == 2}

{if useNewVipIcon}

{else}

{/if}

{elseif x.user.vipRights.redVipLevel == 3}

{if useNewVipIcon}

{else}

{/if}

{elseif x.user.vipRights.redVipLevel == 4}

{if useNewVipIcon}

{else}

{/if}

{elseif x.user.vipRights.redVipLevel == 5}

{if useNewVipIcon}

{else}

{/if}

{elseif x.user.vipRights.redVipLevel == 6}

{if useNewVipIcon}

{else}

{/if}

{elseif x.user.vipRights.redVipLevel == 7}

{if useNewVipIcon}

{else}

{/if}

{/if}

{elseif x.user.vipRights.musicPackage && x.user.vipRights.musicPackage.rights}

{if x.user.vipRights.musicPackage.iconUrl}

{else}

{/if}

{elseif x.user.vipRights.redVipAnnualCount >= 1}

{if useNewVipIcon}

{else}

{/if}

{elseif x.user.vipRights.associator && x.user.vipRights.associator.rights}

{if useNewVipIcon}

{else}

{/if}

{/if}

{/if}

{if !!x.beRepliedUser}

 回复 ${escape(x.beRepliedUser.nickname)}

${getAuthIcon(x.beRepliedUser)}

{if x.beRepliedUser.vipRights}

{if x.beRepliedUser.vipRights.redplus && x.beRepliedUser.vipRights.redplus.vipCode === 300 && x.beRepliedUser.vipRights.redplus.rights && x.beRepliedUser.vipRights.redplus.iconUrl}

{elseif x.beRepliedUser.vipRights.associator && x.beRepliedUser.vipRights.associator.rights}

{if x.beRepliedUser.vipRights.redVipAnnualCount >= 1}

{if useNewVipIcon}

{else}

{/if}

{elseif x.beRepliedUser.vipRights.associator.iconUrl}

{else}

{if useNewVipIcon}

{else}

{/if}

{/if}

{elseif x.beRepliedUser.vipRights.musicPackage && x.beRepliedUser.vipRights.musicPackage.rights}

{if x.beRepliedUser.vipRights.musicPackage.iconUrl}

{else}

{/if}

{/if}

{/if}

{/if}

:${getRichText(escape(x.content),'s-fc7')}

{if !!x.expressionUrl}

{/if}

{if x.beReplied&&x.beReplied.length}

{var replied = x.beReplied[0]}

◆◆

{if (replied && replied.status>=0) && (replied.content || replied.expressionUrl)}

${replied.user.nickname}${getAuthIcon(replied.user)}

{if replied.user.vipRights}

{if replied.user.vipRights.redplus && replied.user.vipRights.redplus.vipCode === 300 && replied.user.vipRights.redplus.rights && replied.user.vipRights.redplus.iconUrl}

{elseif replied.user.vipRights.associator && replied.user.vipRights.associator.rights}

{if replied.user.vipRights.redVipAnnualCount >= 1}

{if useNewVipIcon}

{else}

{/if}

{elseif replied.user.vipRights.associator.iconUrl}

{else}

{if useNewVipIcon}

{else}

{/if}

{/if}

{elseif replied.user.vipRights.musicPackage && replied.user.vipRights.musicPackage.rights}

{if replied.user.vipRights.musicPackage.iconUrl}

{else}

{/if}

{/if}

{/if}

:${getRichText(escape(replied.content),'s-fc7')}

{if !!replied.expressionUrl}

{/if}

{else}

该评论已删除

{/if}

{/if}

${timeformat(x.time)}

{if x.topCommentId}音乐人置顶{/if}

{if canTop()&&GUser&&GUser.userId&&(GUser.userId==x.user.userId)}

{if x.topCommentId}解除置顶{else}置顶评论{/if}|

{/if}

{if GUser&&GUser.userId&&(GUser.userId==x.user.userId||GUser.userId==resUserId)}

删除|

{else}

删除|

{/if}

{if GAllowRejectComment}

{if hot||!x.isRemoveHotComment}

移除精彩评论|

{else}

已移除精彩评论|

{/if}

{/if}

{if !x.topCommentId}{if x.likedCount} (${getPlayCount(x.likedCount)}){/if}

|{/if}

回复

{/if}

{/list}

{list beg..end as y}

{var x=xlist[y]}

${escape(x.user.nickname)}

{if x.user.avatarDetail && x.user.avatarDetail.identityIconUrl}

{/if}

{if x.user.vipRights}

{if x.user.vipRights.redplus && x.user.vipRights.redplus.vipCode === 300 && x.user.vipRights.redplus.rights && x.user.vipRights.redplus.iconUrl}

{elseif x.user.vipRights.associator && x.user.vipRights.associator.rights}

{if x.user.vipRights.associator.iconUrl}

{elseif x.user.vipRights.redVipLevel == 1}

{elseif x.user.vipRights.redVipLevel == 2}

{elseif x.user.vipRights.redVipLevel == 3}

{elseif x.user.vipRights.redVipLevel == 4}

{elseif x.user.vipRights.redVipLevel == 5}

{elseif x.user.vipRights.redVipLevel == 6}

{elseif x.user.vipRights.redVipLevel == 7}

{/if}

{elseif x.user.vipRights.musicPackage && x.user.vipRights.musicPackage.rights}

{if x.user.vipRights.musicPackage.iconUrl}

{else}

{/if}

{/if}

{/if}

{if !!x.beRepliedUser}

 回复 ${escape(x.beRepliedUser.nickname)}

${getAuthIcon(x.beRepliedUser)}

{if x.beRepliedUser.vipRights}

{if x.beRepliedUser.vipRights.redplus && x.beRepliedUser.vipRights.redplus.vipCode === 300 && x.beRepliedUser.vipRights.redplus.rights && x.beRepliedUser.vipRights.redplus.iconUrl}

{elseif x.beRepliedUser.vipRights.associator && x.beRepliedUser.vipRights.associator.rights}

{if x.beRepliedUser.vipRights.redVipAnnualCount >= 1}

{elseif x.beRepliedUser.vipRights.associator.iconUrl}

{else}

{/if}

{elseif x.beRepliedUser.vipRights.musicPackage && x.beRepliedUser.vipRights.musicPackage.rights}

{if x.beRepliedUser.vipRights.musicPackage.iconUrl}

{else}

{/if}

{/if}

{/if}

{/if}

:${getRichText(escape(x.content),'s-fc7')}

{if !!x.expressionUrl}

{/if}

{if x.beReplied&&x.beReplied.length}

{var replied = x.beReplied[0]}

◆◆

{if replied&&replied.content}

${replied.user.nickname}${getAuthIcon(replied.user)}

{if replied.user.vipRights}

{if replied.user.vipRights.redplus && replied.user.vipRights.redplus.vipCode === 300 && replied.user.vipRights.redplus.rights && replied.user.vipRights.redplus.iconUrl}

{elseif replied.user.vipRights.associator && replied.user.vipRights.associator.rights}

{if replied.user.vipRights.redVipAnnualCount >= 1}

{elseif replied.user.vipRights.associator.iconUrl}

{else}

{/if}

{elseif replied.user.vipRights.musicPackage && replied.user.vipRights.musicPackage.rights}

{if replied.user.vipRights.musicPackage.iconUrl}

{else}

{/if}

{/if}

{/if}

:${getRichText(escape(replied.content),'s-fc7')}

{else}

该评论已删除

{/if}

{/if}

${timeformat(x.time)}

{if GUser&&GUser.userId&&(GUser.userId==x.user.userId||GUser.userId==resUserId)}

删除|

{else}

删除|

{/if}

{if x.likedCount} (${getPlayCount(x.likedCount)}){/if}

|

回复

{/list}

评论

110/120

◆◆

◆◆

回复

110/120

回复

110/120

发送110/120

评论

110/120

发送

110/120

新歌单

加载中...

{list beg..end as y}

{var x=xlist[y]}

{if x.highQuality}{/if}

${escape(cutStr(x.name,40))}

${x.trackCount}首

{if x.trackCount+size>10000}歌单已满{/if}

{/list}

说点什么

140

转发

取消

  歌曲同步完成

查看我的音乐

{if suggests.length == 0}

轻敲空格完成输入

{else}

选择最近@的人或直接输入

{/if}

{list suggests as suggest}

${suggest.nickname}

{/list}

{if receiver}

${receiver.nickname}×

{/if}

选择或输入好友昵称

{list users as user}

${user.nickname}

{/list}

{list users as user}

${user.nickname}

{/list}

分享给大家

私信分享

最多选择10位好友

140/140

分享

取消

同时分享到:

{macro listArtists(artists)}

{list artists as art}

${art.name|mark} 

{/list}

{/macro}

搜“${keyword|cutStr}” 相关用户 >

{list result.order as index}

{var lst=result[index]}

{if !!lst&&!!lst.length}

{if index=="songs"}

单曲

{list lst as song}

${song.name|mark}-${listArtists(song.artists)}

{/list}

{elseif index=="artists"}

歌手

{list lst as artist}

${artist.name|mark}

{/list}

{elseif index=="albums"}

专辑

{list lst as album}

${album.name|mark}{if album.artist}-${album.artist.name|mark}{/if}

{/list}

{elseif index=="playlists"}

歌单

{list lst as playlist}

${playlist.name|mark}

{/list}

{elseif index=="mvs"}

视频

{list lst as mv}

MV:${mv.name|mark}{if mv.artistName}-${mv.artistName|mark}{/if}

{/list}

{/if}

{/if}

{/list}

${info|escape}

{if canChange}{/if}

${title}

{if !fail}

{else}

${fail}

{/if}

{if !fail}

{else}

${fail}

{/if}

   

 

知道了

上传节目

删除

取消

服务条款和隐私政策更新

服务条款

同意

{list buttons as item}

${item.text}

{/list}

微信

易信

QQ空间

LOFTER

message

知道了

新浪微博

腾讯微博

豆瓣

140

分享

取消

${tip}

${oktext}

${cctext}

${tip}

${oktext}

{if showSongText}${songTxt}{/if}

${tip}

{if typeof(oktext) != 'undefined'}${oktext}{/if}

{if typeof(cctext) != 'undefined'}${cctext}{/if}

${tip}

{if typeof(oktext) != 'undefined'}${oktext}{/if}

{if typeof(cctext) != 'undefined'}${cctext}{/if}

该资源为公益歌曲

捐赠任意金额(2~4999元)即可无限畅听下载

新浪微博

微信

易信好友

QQ空间

LOFTER

豆瓣

悬赏1积分让大家来帮你补歌词,是否继续?

若30天内歌词未补充,积分将退还给您

继续求

取消

原手机号已停用

(使用其他方式验证)

原手机号仍能使用

(使用手机验证码验证)

{if hasWx}

点击使用微信验证

{/if}

{if hasQQ}

点击使用QQ验证

{/if}

请填写以下安全问题的答案

问题:

回答:

账号或密码错误

上一步

下一步

-请选择-

deepin15(64位)

ubuntu18.04(64位)

您的系统为Windows 10,推荐下载UWP版

下载UWP版本

继续下载PC版本

{list options as o}

${o|filter}

{/list}

使用云音乐客户端

即可无限下载高品质音乐

Mac版V1.9.1

PC版V1.9.1

已安装PC版

扫描下载手机版

该资源为付费内容,扫描下方二维码,使用最新的安卓或iPhone版本购买后即可畅享

{var title=""}

{if artists && artists.length}

{list artists as x}

{if x}

{var title = title + x.name}

{if x_index < x_length - 1}

{var title = title + " / "}

{/if}

{/if}

{/list}

{/if}

${escape(title)}

{if artists && artists.length}

{list artists as x}

{if !!x}

{if !!x.id}

${mark(escape(x.name))}

{else}

${mark(escape(x.name))}

{/if}

{if x_index < x_length - 1} / {/if}

{/if}

{/list}

{/if}

${comJST('com-mv-artists', artists, clazz, mark, boxClazz)}

{if x.userType==4}${before}${after}{elseif x.authStatus==1}${before}${after}{elseif (x.expertTags && x.expertTags.length>0) || !isEmptyObject(x.experts)}${before}${after}{/if}

{if loginUserProfile.avatarDetail&&loginUserProfile.avatarDetail.identityIconUrl}

{/if}

{if x.avatarDetail && x.avatarDetail.identityIconUrl}

{/if}

1/2

{list plist as item}

{/list}

 

{list beg..end as y}

{var x=xlist[y]}

 

${y+1}

{if type=='rank'}

{if x.lastRank>=0}

{if y-x.lastRank>0}

${y-x.lastRank}

{elseif y-x.lastRank==0}

0

{else}

${x.lastRank-y}

{/if}

{else}

{/if}

{/if}

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

${dur2time(x.duration/1000)}{if x.ftype==2}{/if}

分享

{if canDel}

删除

{/if}

${getArtistName(x.artists, '', '', false, false, true)}

{if type=='dayRcmd'}

{if x.album}${x.album.name}{/if}

不感兴趣

{else}

{if x.album}

${soil(x.album.name)}

{/if}

{/if}

{/list}

 

歌曲标题

时长

歌手

{list beg..end as y}

{var x=xlist[y]}

 

${y+1}

{if type=='rank'}

{if x.lastRank>=0}

{if y-x.lastRank>0}

${y-x.lastRank}

{elseif y-x.lastRank==0}

0

{else}

${x.lastRank-y}

{/if}

{else}

{/if}

{/if}

{if x.privilege.fee == 1}

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

{else}

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

{/if}

${dur2time(x.duration/1000)}{if x.ftype==2}{/if}

分享

{if canDel}

删除

{/if}

${getArtistName(x.artists, '', '/', false, true, true)}

{/list}

{list beg..end as y}

{var x=xlist[y]}

 

${y+1}

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

${dur2time(x.duration/1000)}{if x.ftype==2}{/if}

分享

{if canDel}

删除

{/if}

{if x.album}

{var transName = x.album.tns && x.album.tns.length > 0 ? x.album.tns[0] : ''}

${soil(x.album.name)}

{if transName}

- (${transName|escape})

{/if}

{/if}

{/list}

标题

时长

歌手

{list beg..end as y}

{var x=xlist[y]}

{if y<3}

${y+1}

{if x.lastRank>=0}

{if y-x.lastRank>0}

${y-x.lastRank}

{elseif y-x.lastRank==0}

0

{else}

${x.lastRank-y}

{/if}

{else}

{/if}

{if x.album}{/if}

 

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

{else}

${y+1}

{if x.lastRank>=0}

{if y-x.lastRank>0}

${y-x.lastRank}

{elseif y-x.lastRank==0}

0

{else}

${x.lastRank-y}

{/if}

{else}

{/if}

 

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

{/if}

${dur2time(x.duration/1000)}{if x.ftype==2}{/if}

分享

{if canDel}

删除

{/if}

${getArtistName(x.artists, '', '', false, false, true)}

{/list}

{list beg..end as y}

{var x=xlist[y]}

 

${y+1}

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

${dur2time(x.duration/1000)}{if x.ftype==2}{/if}

分享

{if canDel}

删除

{/if}

${getArtistName(x.artists, '', '', false, false, true)}

{if x.album}

${soil(x.album.name)}

{/if}

{/list}

{list beg..end as y}

{var x=xlist[y]}

{if extData&&extData.limit&&y>=extData.limit}

{break}

{/if}

{var from=getFrom()}

 

${y+1}.

${x.name}

-

${getArtistName(x.artists, 's-fc8')}

分享

下载

{if extData.showCount&&x.playCount}${x.playCount}次{/if}

{/list}

{if extData&&extData.limit&&xlist.length>extData.limit}

查看更多>

{/if}

{list beg..end as y}

{var x=xlist[y]}

 

${y+1}

{if type=='rank'}

{if x.lastRank>=0}

{if y-x.lastRank>0}

${y-x.lastRank}

{elseif y-x.lastRank==0}

0

{else}

${x.lastRank-y}

{/if}

{else}

{/if}

{/if}

{var alia=songAlia(x)}

${soil(x.name)}{if alia} - (${soil(alia)}){/if}

{if x.mvid>0}

MV

{/if}

分享

{if canDel}

删除

{/if}

${getArtistName(x.artists, '', '', false, false, true)}

{if x.album}

${soil(x.album.name)}

{/if}

${formatTime(x.paidTime)}

{/list}

最多选择10位好友

发 给:

内 容:

fsdfsf-CSDN博客

>

fsdfsf-CSDN博客

fsdfsf

最新推荐文章于 2021-08-10 17:14:18 发布

ubeyondi

最新推荐文章于 2021-08-10 17:14:18 发布

阅读量495

收藏

点赞数

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/ubeyondi/article/details/5994508

版权

加入csdn很高兴

优惠劵

ubeyondi

关注

关注

0

点赞

0

收藏

觉得还不错?

一键收藏

知道了

0

评论

fsdfsf


加入csdn很高兴

复制链接

扫一扫

fsdfsf.zip_led clock

09-20

p3212.asm p3.2小键盘控制p1.2发光管的程序。 p3305.asm p3.3小键盘控制p1.3led,瞬间亮, 0.5s熄灭。 p3355.asm p3.3小键盘控制p1.3led,0.5s亮, 0.5s熄灭。 keyshuzi.asm 四个小键盘控制的数字显示. ...

fsdf

iteye_13324的博客

07-18

81

dsfsdf

参与评论

您还未登录,请先

登录

后发表或查看评论

fscanf()函数详解

热门推荐

liangxanhai的专栏

09-27

24万+

以前解析有规律的文件的时候要么用正则表达式,要么就是傻傻的自己写程序来解析有规律的文件。今天突然发现c的库函数中有一个现成的可以解析有规律的文件的函数,就是fscanf()函数。哎 以前自己做了这么多无用功,在这里详细解析一下fscanf函数:

fscanf()函数(有点像正则表达式):

功 能: 从一个流中执行格式化输入,fscanf遇到空格和换行时结束,注意空格时也结束。

用 法:i

mybatis源码---Executor执行器

m0_46633875的博客

08-10

100

java原生jdbc操作

流程

读取配置信息(基本信息)

加载驱动

获取连接

获取PreparedStatement的实例 (或:预编译sql语句)

针对结果集的处理(增删改用 execute() 不需处理结果集,查询用 .executeQuery(); )

关闭连接

流程图

示例

//获取连接

Connection conn = JDBCUtils.getConnection();

String sql = "insert intocustomers(name,email,birth,photo)

KEEPALIVED+MYSQL主主同步=MYSQL高可用(HA)集群.docx

07-06

KEEPALIVED+MYSQL主主同步=MYSQL高可用(HA)集群.docx

ddfdfdffdfsfs

12-05

fsfsfsfsfsdf

Java毕设-基于springboot+Vue的流浪动物管理系统2(附源码,数据库,教程).zip

03-06

Java 毕业设计,Java 课程设计,基于 SpringBoot 开发的,含有代码注释,新手也可看懂。毕业设计、期末大作业、课程设计、高分必看,下载下来,简单部署,就可以使用。

包含:项目源码、数据库脚本、软件工具等,前后端代码都在里面。

该系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值。

项目都经过严格调试,确保可以运行!

1. 技术组成

前端:html、javascript、Vue

后台框架:SpringBoot

开发环境:idea

数据库:MySql(建议用 5.7 版本,8.0 有时候会有坑)

数据库工具:navicat

部署环境:Tomcat(建议用 7.x 或者 8.x 版本), maven

2. 部署

如果部署有疑问的话,可以找我咨询

后台路径地址:localhost:8080/项目名称/admin/dist/index.html

前台路径地址:localhost:8080/项目名称/front/index.html (无前台不需要输入)

Swift 基础库. A collection of Swift extensions and utilities.zip

03-06

Swift 基础库. A collection of Swift extensions and utilities.zip

剪映使用教程s240306.pptx

03-06

剪映使用教程s240306.pptx

OFO共享单车(Swift版).zip

03-06

OFO共享单车(Swift版).zip

快速、简洁、解决大文件内存溢出的java处理Excel工具.zip

03-06

Java语音项目的资源包括原生的JSAPI、开源库如CMU Sphinx和FreeTTS,商业化的服务如Google Cloud Speech-to-Text API,以及其他框架和工具。通过利用这些资源,您可以开发出功能强大的语音应用程序。Java语音项目的资源包括原生的JSAPI、开源库如CMU Sphinx和FreeTTS,商业化的服务如Google Cloud Speech-to-Text API,以及其他框架和工具。通过利用这些资源,您可以开发出功能强大的语音应用程序。

ScrollView嵌套ScrolloView解决方案支持OC _ Swift

03-06

ScrollView嵌套ScrolloView(UITableView 、UICollectionView)解决方案, 支持OC _ Swift(持续更新中...)实现原理:.zip

springboot150基于springboot的贸易行业crm系统-毕业源码案例设计

03-06

随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了基于springboot的贸易行业crm系统的开发全过程。通过分析基于springboot的贸易行业crm系统管理的不足,创建了一个计算机管理基于springboot的贸易行业crm系统的方案。文章介绍了基于springboot的贸易行业crm系统的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本基于springboot的贸易行业crm系统有管理员和员工两个角色。管理员功能有个人中心,部门管理,员工管理,产品分类管理,产品信息管理,客户信息管理,市场活动管理,销售订单管理,配送订单管理。员工可以操作自己的个人中心,客户信息,产品信息,销售订单,配送订单,售后回访等。因而具有一定的实用性。

本站是一个B/S模式系统,采用Spring Boot框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得基于springboot的贸易行业crm系统管理工作系统化、规范化。本系统的使用使管理人员从繁重的工作中解脱出来,实现

Java毕设-基于springboot+vue的文理医院预约挂号系统(附源码,数据库,教程).zip

03-06

Java 毕业设计,Java 课程设计,基于 SpringBoot 开发的,含有代码注释,新手也可看懂。毕业设计、期末大作业、课程设计、高分必看,下载下来,简单部署,就可以使用。

包含:项目源码、数据库脚本、软件工具等,前后端代码都在里面。

该系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值。

项目都经过严格调试,确保可以运行!

1. 技术组成

前端:html、javascript、Vue

后台框架:SpringBoot

开发环境:idea

数据库:MySql(建议用 5.7 版本,8.0 有时候会有坑)

数据库工具:navicat

部署环境:Tomcat(建议用 7.x 或者 8.x 版本), maven

2. 部署

如果部署有疑问的话,可以找我咨询

后台路径地址:localhost:8080/项目名称/admin/dist/index.html

前台路径地址:localhost:8080/项目名称/front/index.html (无前台不需要输入)

30-localStorage封装.ts

03-06

30-localStorage封装

maven+ssm+redis 项目集成.zip

03-06

资源简介:SSM Java 项目集合

一、概述

在这个平台上,我们为大家带来了一系列的 JavaSSM(Spring + SpringMVC + MyBatis)项目。这些项目旨在展示SSM框架在实际应用中的魅力,同时也为开发者提供了一个快速学习和实践的机会。通过下载和使用这些项目,您将能够深入了解SSM框架的核心概念、设计模式和最佳实践。

二、项目特点

实战性强:这些项目均来自实际业务场景多个领域,具有很强的实战性和参考价值。

技术先进:所有项目均采用最新的SSM框架版本,包括Spring 、SpringMVC 和MyBatis 等,确保技术的先进性和稳定性。

代码规范:项目代码严格按照行业标准和最佳实践进行编写,易于阅读和维护。

文档齐全:每个项目都配备了详细的开发文档和使用说明,方便您快速上手和定制开发。

三、适用人群

Java初学者:通过学习和实践这些项目,您将能够快速掌握SSM框架的基础知识和核心技术。

中高级开发者:这些项目将为您提供丰富的实战经验和灵感,帮助您提升技术水平和解决问题的能力。

项目经理和架构师:这些项目可以作为参考和模板,帮助您更好地规划和设计实际业务场景中的Java项目。

四、下载与使用

下载:所有项目均提供下载,您只需在平台上注册并登录即可获取。

安装与部署:每个项目都提供了详细的安装和部署指南,帮助您快速搭建和运行项目。

定制开发:您可以根据实际需求对项目进行定制开发,扩展功能和优化性能。

五、结语

通过这一系列SSM Java项目的下载和学习,您将能够深入了解SSM框架的核心技术,提升自己的编程能力,并在实际业务场景中灵活应用。我们期待您能够通过这些项目获得更多的成长和进步!

海尔智能电视刷机数据 LS55M31M1A1 机编DH1VF0A1305 务必确认机编一致 强制刷机 整机USB升级主程序

03-06

务必确认机身编号与文件名机编一致,如不一致,请勿下载

机身编号一般在机子背面的贴纸上

升级方法:

1、下载数据,压缩包解压,将“Haier638Upgrade.bin”文件拷贝到U盘根目录下(U盘要求使用FAT32格式,建议4G-8G的品牌U盘,刷机成功率会高)

2、电视关机拔下电源,插入U盘,按住机身按键板上的“菜单”键不放,插电开机,直到LED灯开始闪表示升级正在进行,升级成功后机器会自动重起。

3、重启之后,重新交流上电,升级完成。

注意:

1、升级到结束,大约需要8-30分钟,中途绝对不能断电

2、升级重启第一次进入系统,请等完全正常进入开机桌面之后,才能拨下U盘

swift5.0,定时器,活动倒计时,alter弹框,吐司弹框.zip

最新发布

03-06

swift5.0,定时器,活动倒计时,alter弹框,吐司弹框.zip

“相关推荐”对你有帮助么?

非常没帮助

没帮助

一般

有帮助

非常有帮助

提交

ubeyondi

CSDN认证博客专家

CSDN认证企业博客

码龄13年

暂无认证

1

原创

157万+

周排名

217万+

总排名

495

访问

等级

14

积分

2

粉丝

0

获赞

0

评论

0

收藏

私信

关注

热门文章

fsdfsf

495

您愿意向朋友推荐“博客详情页”吗?

强烈不推荐

不推荐

一般般

推荐

强烈推荐

提交

最新文章

2010年1篇

目录

目录

最新文章

2010年1篇

目录

评论

被折叠的  条评论

为什么被折叠?

到【灌水乐园】发言

查看更多评论

添加红包

祝福语

请填写红包祝福语或标题

红包数量

红包个数最小为10个

红包总金额

红包金额最低5元

余额支付

当前余额3.43元

前往充值 >

需支付:10.00元

取消

确定

下一步

知道了

成就一亿技术人!

领取后你会自动成为博主和红包主的粉丝

规则

hope_wisdom 发出的红包

实付元

使用余额支付

点击重新获取

扫码支付

钱包余额

0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值

FastDFS基础学习(三)之通过fastdfs-client-java使用FastDFS进行上传,下载,删除,修改操作-CSDN博客

>

FastDFS基础学习(三)之通过fastdfs-client-java使用FastDFS进行上传,下载,删除,修改操作-CSDN博客

FastDFS基础学习(三)之通过fastdfs-client-java使用FastDFS进行上传,下载,删除,修改操作

我是一个小仓鼠01

已于 2022-08-02 22:43:51 修改

阅读量1.7k

收藏

4

点赞数

2

分类专栏:

文件上传

文章标签:

学习

于 2022-08-01 18:27:40 首次发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/weixin_53998054/article/details/126104560

版权

文件上传

专栏收录该内容

5 篇文章

0 订阅

订阅专栏

Java上传文件

首先拉取最新的FastDFS代码

GitHub - wangwei216/fastdfs-client-java-master

打包到本地

mvn clean install

更换jdk版本  

        

        1.6

        

        1.8

新建一个springboot项目

 创建一个controller用来进行测试

@RestController

@RequestMapping("/fdfs")

public class FdfsController {

@GetMapping(value = "/hello")

public String hello(){

return "桃李不言下";

}

}

配置文件启动端口修改一下

server.port=8090

pom.xml文件

1.8

1.2.75

5.5.2

1.1.2

2.8.0

3.11

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-webflux

org.springframework.session

spring-session-core

org.springframework.boot

spring-boot-devtools

runtime

true

org.springframework.boot

spring-boot-configuration-processor

true

org.projectlombok

lombok

true

org.springframework.boot

spring-boot-starter-tomcat

provided

org.springframework.boot

spring-boot-starter-test

test

io.projectreactor

reactor-test

test

cn.hutool

hutool-all

${hutool.version}

com.github.binarywang

java-testdata-generator

${generator.version}

commons-io

commons-io

${commons-io.version}

com.alibaba

fastjson

${fastjson.version}

org.apache.commons

commons-lang3

${commons-lang3.version}

org.csource

fastdfs-client-java

1.29-SNAPSHOT

org.slf4j

slf4j-log4j12

org.springframework.boot

spring-boot-maven-plugin

2.5.10

 resources下fastdfs-client.properties

#连接超时时间,单位为秒。

fastdfs.connect_timeout_in_seconds = 5

#通信超时时间,单位为秒。发送或接收数据时。假设在超时时间后还不能发送或接收数据,则本次网络通信失败

fastdfs.network_timeout_in_seconds = 30

#charset: 字符集

fastdfs.charset = UTF-8

fastdfs.http_anti_steal_token = false

fastdfs.http_secret_key = FastDFS1234567890

#tracker的http端口

fastdfs.http_tracker_http_port = 28083

#tracker服务器IP和端口设置

fastdfs.tracker_servers = 39.97.100.141:22122

fastdfs.connection_pool.enabled = true

fastdfs.connection_pool.max_count_per_entry = 500

fastdfs.connection_pool.max_idle_time = 3600

fastdfs.connection_pool.max_wait_time_in_ms = 1000

application.yml

server:

port: 8090

spring:

servlet:

multipart:

max-file-size: 50MB #文件上传大小限制为

max-request-size: 200MB #请求大小限制为

#查看图片的端口号

fdfs_storage_proxy:

protocol: http://

domain: 192.168.178.130

port: 8888

 测试

import org.springframework.beans.factory.annotation.Value;

import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

@RestController

@RequestMapping("/fdfs")

public class FdfsController {

@Value("${fdfs_storage_proxy.protocol}")

private String fdfs_storage_proxy_protocol;

@Value("${fdfs_storage_proxy.domain}")

private String fdfs_storage_proxy_domain;

@Value("${fdfs_storage_proxy.port}")

private String fdfs_storage_proxy_port;

@GetMapping("/proxy")

public String proxy(){

return fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;

}

@GetMapping(value = "/hello")

public String hello(){

return "桃李不言下";

}

}

返回值状态枚举

ResultCode.enum

/*

* 返回值状态枚举

* */

public enum ResultCode {

/*

* 操作成功 请求成功

* */

SUCCESS("200","操作成功","请求成功"),

/*

* 上传失败

* */

UPLOAD_FAILED("700","上传失败","上传失败");

/*

* 状态码

* */

private String code;

/*

* 状态码含义

* */

private String msg;

/*

* 状态码含义描述

* */

private String desc;

ResultCode(String code,String msg,String desc){

this.code=code;

this.msg=msg;

this.desc=desc;

}

public String getCode() {

return code;

}

public String getMsg() {

return msg;

}

public String getDesc() {

return desc;

}

public void setCode(String code) {

this.code = code;

}

public void setMsg(String msg) {

this.msg = msg;

}

public void setDesc(String desc) {

this.desc = desc;

}

}

R.java

/*

* 统一返回数据格式

* */

@NoArgsConstructor

@AllArgsConstructor

@Getter

@Setter

public class R{

/*

* 状态码

* */

private String code;

/*

* 状态码含义

* */

private String msg;

/*

* 状态码含义描述

* */

private T data;

}

FdfsController.java

@RestController

@RequestMapping("/fdfs")

public class FdfsController {

@Value("${fdfs_storage_proxy.protocol}")

private String fdfs_storage_proxy_protocol;

@Value("${fdfs_storage_proxy.domain}")

private String fdfs_storage_proxy_domain;

@Value("${fdfs_storage_proxy.port}")

private String fdfs_storage_proxy_port;

@GetMapping("/proxy")

public String proxy(){

return fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;

}

@GetMapping(value = "/hello")

public String hello(){

return "桃李不言下";

}

@RequestMapping("/upload1")

public Rupdate01(@RequestParam("header")MultipartFile multipartFile){

//封装返回数据 默认为上传失败

R response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null);

//获取原文件的名字

String originalFilename = multipartFile.getOriginalFilename();

//获取源文件后缀名

String suffix = FilenameUtils.getExtension(originalFilename);

//文件上传

try {

//加载fastdfs-client.properties配置文件

ClientGlobal.initByProperties("fastdfs-client.properties");

//获取tracker和storage客户端对象

TrackerClient client = new TrackerClient();

//获取tracker地址

TrackerServer trackerServer = client.getTrackerServer();

StorageServer storageServer=null;

//获取storage地址

StorageClient storageClient = new StorageClient(trackerServer, storageServer);

//文件上传字节数组

InputStream inputStream = multipartFile.getInputStream();

int length = inputStream.available();

byte[] bytes = new byte[length];

//文件上传成功后重新封装返回数据

inputStream.read(bytes);

String[] result = storageClient.upload_file(bytes, suffix, null);

System.out.println(JSON.toJSONString(result));

//文件上传后,重新封装返回数据

response.setCode(ResultCode.SUCCESS.getCode());

response.setMsg(ResultCode.SUCCESS.getMsg());

String url =fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port+"/" +result[0]+"/"+result[1];

response.setData(url);

} finally {

//向用户响应上传成功的访问地址

return response;

}

}

}

 封装成Utils工具类

BaseFastDFSUtil.java

/*

* FastDFS工具类

* */

public class BaseFastDFSUtil {

/*

* 配置文件

* */

private final static String propFilePath="fastdfs-client.properties";

static {

//加载fastdfs-client.properties配置文件

try {

ClientGlobal.initByProperties(propFilePath);

} catch (IOException | MyException e) {

e.printStackTrace();

}

}

/*

*文件上传到fastdfs

*fdfs_storage_proxy_url storage web服务地址

* inputStream 上传文件的自己输入流

* file_etx_name 上传文件的后缀名

* 上传成功后的web地址

* */

public static String upload(String fdfs_storage_proxy_url, InputStream inputStream,String file_ext_name) throws Exception {

//获取tracker和storage客户端对象

TrackerClient client = new TrackerClient();

//获取tracker地址

TrackerServer trackerServer = client.getTrackerServer();

StorageServer storageServer=null;

//获取storage地址

StorageClient storageClient = new StorageClient(trackerServer, storageServer);

int length = inputStream.available();

byte[] bytes = new byte[length];

//文件上传成功后重新封装返回数据

inputStream.read(bytes);

String[] result = storageClient.upload_file(bytes, file_ext_name, null);

System.out.println(JSON.toJSONString(result));

//断开连接

storageClient.close();

return fdfs_storage_proxy_url+"/" +result[0]+"/"+result[1];

}

}

FdfsController.java

@RestController

@RequestMapping("/fdfs")

public class FdfsController {

@Value("${fdfs_storage_proxy.protocol}")

private String fdfs_storage_proxy_protocol;

@Value("${fdfs_storage_proxy.domain}")

private String fdfs_storage_proxy_domain;

@Value("${fdfs_storage_proxy.port}")

private String fdfs_storage_proxy_port;

@GetMapping("/proxy")

public String proxy(){

return fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;

}

@GetMapping(value = "/hello")

public String hello(){

return "桃李不言下";

}

@RequestMapping("/upload1")

public Rupdate01(@RequestParam("header")MultipartFile multipartFile){

//封装返回数据 默认为上传失败

R response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null);

//获取原文件的名字

String originalFilename = multipartFile.getOriginalFilename();

//获取源文件后缀名

String suffix = FilenameUtils.getExtension(originalFilename);

//文件上传

try {

//加载fastdfs-client.properties配置文件

ClientGlobal.initByProperties("fastdfs-client.properties");

//获取tracker和storage客户端对象

TrackerClient client = new TrackerClient();

//获取tracker地址

TrackerServer trackerServer = client.getTrackerServer();

StorageServer storageServer=null;

//获取storage地址

StorageClient storageClient = new StorageClient(trackerServer, storageServer);

//文件上传字节数组

InputStream inputStream = multipartFile.getInputStream();

int length = inputStream.available();

byte[] bytes = new byte[length];

//文件上传成功后重新封装返回数据

inputStream.read(bytes);

String[] result = storageClient.upload_file(bytes, suffix, null);

System.out.println(JSON.toJSONString(result));

//文件上传后,重新封装返回数据

response.setCode(ResultCode.SUCCESS.getCode());

response.setMsg(ResultCode.SUCCESS.getMsg());

//断开连接

storageClient.close();

String url =fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port+"/" +result[0]+"/"+result[1];

response.setData(url);

} finally {

//向用户响应上传成功的访问地址

return response;

}

}

@RequestMapping("/upload2")

public Rupdate02(@RequestParam("header")MultipartFile multipartFile){

//封装返回数据 默认为上传失败

R response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null);

//获取原文件的名字

String originalFilename = multipartFile.getOriginalFilename();

//获取源文件后缀名

String suffix = FilenameUtils.getExtension(originalFilename);

//文件上传

try {

String proxy=fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port;

String url = BaseFastDFSUtil.upload(proxy, multipartFile.getInputStream(), suffix);

//文件上传后,重新封装返回数据

response.setCode(ResultCode.SUCCESS.getCode());

response.setMsg(ResultCode.SUCCESS.getMsg());

response.setData(url);

} finally {

//向用户响应上传成功的访问地址

return response;

}

}

}

下载图片

utils层

/**

* 文件下载

*

* @param groupName 组/卷名,默认值:group1

* @param remoteFileName 文件名,例如:"M00/00/00/wKgKZl9tkTCAJAanAADhaCZ_RF0495.jpg"

* @return 文件的字节输入流

*/

public static InputStream downloadFile(String groupName, String remoteFileName) {

try {

// 链接FastDFS服务器,创建tracker和Stroage

TrackerClient trackerClient = new TrackerClient();

TrackerServer trackerServer = trackerClient.getTrackerServer();

StorageServer storageServer=trackerClient.getStoreStorage(trackerServer);

//定义Stroage客户端对象,需要使用这个对象来完成具体的文件上传,下载和删除操作

StorageClient storageClient = new StorageClient(trackerServer,storageServer);

// 根据组名和文件名通过 Storage 客户端获取文件的字节数组

byte[] bytes = storageClient.download_file(groupName == null ? "group1" : groupName, remoteFileName);

// 返回字节流对象

InputStream inputStream = new ByteArrayInputStream(bytes);

return inputStream;

} catch (IOException e) {

e.printStackTrace();

} catch (MyException e) {

e.printStackTrace();

}

return null;

}

Controller层

/**

* 文件下载

*/

@PostMapping("/downloadFile")

public R downloadFile(@RequestParam("groupName")String groupName,@RequestParam("remoteFileName") String remoteFileName) throws Exception {

//封装返回数据 默认为上传失败

R response = new R<>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMsg(), "下载成功");

//调用下载接口

InputStream is = BaseFastDFSUtil

.downloadFile(groupName, remoteFileName);

File file = new File("D:/" + remoteFileName);

//判断目录是否存在如果不存在则存在

//getParent()——得到路径的父级及以上的目录,String类型。

//getParentFile()——得到路径的父级及以上的目录实例化的File对象。

//createNewFile()创建文件

//mkdir()——仅创建一层目录,返回true或false.

//mkdirs()——创建一层或多层目录,返回true或false.

if (!file.exists()){

boolean dr = file.getParentFile().mkdirs(); //创建目录

}

OutputStream os = new FileOutputStream(new File("D:/" + remoteFileName));

int index = 0 ;

while((index = is.read())!=-1){

os.write(index);

}

os.flush();

os.close();

is.close();

return response;

}

删除图片

Utils层

/**

* 文件删除

*

* @param groupName 组/卷名,默认值:group1

* @param remoteFileName 文件名,例如:"M00/00/00/wKgKZl9tkTCAJAanAADhaCZ_RF0495.jpg"

* @return 0为成功,非0为失败

*/

public static int deleteFile(String groupName, String remoteFileName) {

int result = -1;

try {

// 链接FastDFS服务器,创建tracker和Stroage

TrackerClient trackerClient = new TrackerClient();

TrackerServer trackerServer = trackerClient.getTrackerServer();

StorageServer storageServer=trackerClient.getStoreStorage(trackerServer);

//定义Stroage客户端对象,需要使用这个对象来完成具体的文件上传,下载和删除操作

StorageClient storageClient = new StorageClient(trackerServer,storageServer);

// 根据组名和文件名通过 Storage 客户端删除文件

result = storageClient.delete_file(groupName == null ? "group1" : groupName, remoteFileName);

} catch (IOException e) {

e.printStackTrace();

} catch (MyException e) {

e.printStackTrace();

}

return result;

}

Controller层

// 文件删除

@PostMapping("/testDeleteFile")

public void testDeleteFile(@RequestParam("groupName")String groupName,@RequestParam("remoteFileName") String remoteFileName) {

int result = BaseFastDFSUtil.deleteFile(groupName, remoteFileName);

System.out.println("result = " + result);

}

修改文件

Utils工具类层

/**

* 修改一个已经存在的文件

*

* @param oldGroupName 旧组名

* @param oldFileName 旧文件名

* @param file 新文件

* @param fileName 新文件名

* @return

*/

public static String modifyFile(String oldGroupName, String oldFileName, MultipartFile file) throws Exception {

// 先上传

String stringR = update01(file);

// 再删除

int delResult = deleteFile(oldGroupName, oldFileName);

if (delResult != 0) {

return null;

}

return stringR;

}

/*

*文件上传到fastdfs

*fdfs_storage_proxy_url storage web服务地址

* inputStream 上传文件的自己输入流

* file_etx_name 上传文件的后缀名

* 上传成功后的web地址

* */

public static String update01(MultipartFile multipartFile) throws Exception {

//获取原文件的名字

String originalFilename = multipartFile.getOriginalFilename();

//获取源文件后缀名

String suffix = FilenameUtils.getExtension(originalFilename);

//文件上传

//加载fastdfs-client.properties配置文件

ClientGlobal.initByProperties("fastdfs-client.properties");

//获取tracker和storage客户端对象

TrackerClient client = new TrackerClient();

//获取tracker地址

TrackerServer trackerServer = client.getTrackerServer();

StorageServer storageServer = null;

//获取storage地址

StorageClient storageClient = new StorageClient(trackerServer, storageServer);

//文件上传字节数组

InputStream inputStream = multipartFile.getInputStream();

int length = inputStream.available();

byte[] bytes = new byte[length];

//文件上传成功后重新封装返回数据

inputStream.read(bytes);

String[] result = storageClient.upload_file(bytes, suffix, null);

System.out.println(JSON.toJSONString(result));

String url = "http://" + "39.97.100.141" + ":" + "8888" + "/" + result[0] + "/" + result[1];

return url;

}

/*

*文件上传到fastdfs

*fdfs_storage_proxy_url storage web服务地址

* inputStream 上传文件的自己输入流

* file_etx_name 上传文件的后缀名

* 上传成功后的web地址

* */

public static String upload(String fdfs_storage_proxy_url, InputStream inputStream, String file_ext_name) throws Exception {

//获取tracker和storage客户端对象

TrackerClient client = new TrackerClient();

//获取tracker地址

TrackerServer trackerServer = client.getTrackerServer();

StorageServer storageServer=null;

//获取storage地址

StorageClient storageClient = new StorageClient(trackerServer, storageServer);

int length = inputStream.available();

byte[] bytes = new byte[length];

//文件上传成功后重新封装返回数据

inputStream.read(bytes);

String[] result = storageClient.upload_file(bytes, file_ext_name, null);

System.out.println(JSON.toJSONString(result));

//断开连接

storageClient.close();

return fdfs_storage_proxy_url+"/" +result[0]+"/"+result[1];

}

Controller层

// 文件替换

@PostMapping("/testModifyFile")

public String testModifyFile(@RequestParam("groupName")String groupName,@RequestParam("remoteFileName") String remoteFileName,@RequestParam("header")MultipartFile file) throws Exception {

//封装返回数据 默认为上传失败

String fileids = BaseFastDFSUtil.modifyFile(groupName, remoteFileName,file);

return fileids;

}

FastDFS校验文件类型

配置yaml

upload:

base-url: http://116.62.44.5/

allow-types:

- image/jpeg

- image/png

- image/bmp

- image/gif

创建配置类UploadProperties

package com.coydone.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

@ConfigurationProperties(prefix = "upload")

public class UploadProperties {

private String baseUrl;

private List allowTypes;

public String getBaseUrl() {

return baseUrl;

}

public void setBaseUrl(String baseUrl) {

this.baseUrl = baseUrl;

}

public List getAllowTypes() {

return allowTypes;

}

public void setAllowTypes(List allowTypes) {

this.allowTypes = allowTypes;

}

}

在Controller使用

@RestController

@Component

@EnableConfigurationProperties(UploadProperties.class)

@RequestMapping("/fdfs")

public class FdfsController {

@Autowired

private UploadProperties prop;

@RequestMapping("/upload1")

public R update01(@RequestParam("header") MultipartFile multipartFile){

//封装返回数据 默认为上传失败

R response = new R<>(ResultCode.UPLOAD_FAILED.getCode(), ResultCode.UPLOAD_FAILED.getMsg(), null);

//获取原文件的名字

String originalFilename = multipartFile.getOriginalFilename();

//获取源文件后缀名

String suffix = FilenameUtils.getExtension(originalFilename);

System.out.println("获取源文件后缀名"+suffix);

// 1、校验文件类型

String contentType = multipartFile.getContentType();

if (!prop.getAllowTypes().contains(contentType)) {

throw new RuntimeException("文件类型不支持");

}

// 2、校验文件内容

try {

BufferedImage image = ImageIO.read(multipartFile.getInputStream());

if (image == null || image.getWidth() == 0 || image.getHeight() == 0) {

throw new RuntimeException("上传文件有问题");

}

} catch (IOException e) {

throw new RuntimeException("校验文件内容失败"+e.getMessage());

}

try {

//加载fastdfs-client.properties配置文件

ClientGlobal.initByProperties("fastdfs-client.properties");

//获取tracker和storage客户端对象

TrackerClient client = new TrackerClient();

//获取tracker地址

TrackerServer trackerServer = client.getTrackerServer();

StorageServer storageServer=null;

//获取storage地址

StorageClient storageClient = new StorageClient(trackerServer, storageServer);

//文件上传字节数组

InputStream inputStream = multipartFile.getInputStream();

int length = inputStream.available();

byte[] bytes = new byte[length];

//文件上传成功后重新封装返回数据

inputStream.read(bytes);

String[] result = storageClient.upload_file(bytes, suffix, null);

System.out.println(JSON.toJSONString(result));

//文件上传后,重新封装返回数据

response.setCode(ResultCode.SUCCESS.getCode());

response.setMsg(ResultCode.SUCCESS.getMsg());

String url =fdfs_storage_proxy_protocol+fdfs_storage_proxy_domain+":"+fdfs_storage_proxy_port+"/" +result[0]+"/"+result[1];

response.setData(url);

} finally {

//向用户响应上传成功的访问地址

return response;

}

}

}

关注博主即可阅读全文

优惠劵

我是一个小仓鼠01

关注

关注

2

点赞

4

收藏

觉得还不错?

一键收藏

知道了

0

评论

FastDFS基础学习(三)之通过fastdfs-client-java使用FastDFS进行上传,下载,删除,修改操作

SpringBoot集成FastDFS

复制链接

扫一扫

专栏目录

fastdfs-client-java-1.29-SNAPSHOT.jar

07-03

解决 Maven 无法下载 fastdfs-client-java-1.29-SNAPSHOT 依赖,直接下载之后用maven命令存储到本地maven仓库即可。

maven命令

mvn install:install-file -DgroupId=org.csource -DartifactId=fastdfs-client-java -Dversion=1.29-SNAPSHOT -Dpackaging=jar -Dfile=fastdfs-client-java-1.29-SNAPSHOT.jar

pom.xml 文件中写入:

org.csource

fastdfs-client-java

1.29-SNAPSHOT

FastDFS实现文件上传下载的工具类详细步骤

轻狂书生FS的博客

02-26

2391

1、首先加入jar包

net.oschina.zcx7878

fastdfs-client-java

1...

参与评论

您还未登录,请先

登录

后发表或查看评论

fastdfs-client-java-1.29.jar

03-16

mvn install:install-file -DgroupId=org.csource -DartifactId=fastdfs-client-java -Dversion=1.29 -Dpackaging=jar -Dfile=fastdfs-client-java-1.29.jar

org.csource

fastdfs-client-java

1.29

fastdfs-client-1.27.2-API文档-中文版.zip

06-05

赠送jar包:fastdfs-client-1.27.2.jar;

赠送原API文档:fastdfs-client-1.27.2-javadoc.jar;

赠送源代码:fastdfs-client-1.27.2-sources.jar;

赠送Maven依赖信息文件:fastdfs-client-1.27.2.pom;

包含翻译后的API文档:fastdfs-client-1.27.2-javadoc-API文档-中文(简体)版.zip;

Maven坐标:com.github.tobato:fastdfs-client:1.27.2;

标签:github、tobato、fastdfs、client、中文文档、jar包、java;

使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。

人性化翻译,文档中的代码和结构保持不变,注释和说明精准翻译,请放心使用。

fastdfs java客户端_FastDFS的Java客户端访问

weixin_36085931的博客

03-04

402

FastDFS的Java客户端访问:没前奏,直接上车。1、 引入依赖:net.oschina.zcx7878fastdfs-client-java1.27.0.02、在项目resources目录下创建fdfs_client.conf 文件,添加如下配置:connect_timeout=60network_timeout=60charset=UTF-8http.tracker_http...

FastDFS安装步骤以及SpringBoot集成fastdfs-client-java

查查攻城狮

07-06

3588

1、前期准备2、CentOS添加编译环境

yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y

二、磁盘目录

mkdir -p /usr/local/soft #所有安装包目录mkdir -p /data/fastdfs #数据存储位置cd /usr/local/soft

git clone https://github.co

FastDfs分布式文件系统集群搭建及Java客户端使用

sinat_32501475的博客

10-31

1357

FastDfs是一个开源高性能分布式文件系统。它的主要功能包括:文件存储、文件同步和文件访问(文件上传和文件下载),它可以解决高容量和负载平衡问题。FastDfs应满足基于照片共享网站和视频共享网站等文件的网站的要求。

使用fastdfs-client-java

WXL0130的博客

04-01

2291

https://github.com/happyfish100

SpringMVC整合fastdfs-client-java实现web文件上传下载

热门推荐

小灯光环

10-04

3万+

关于SpringMVC整合FastDFS的java客户端fastdfs-client-java实现web中的文件上传下载

fastdfs java client_fastdfs-client-java操作fastdfs5.0.4

weixin_39756895的博客

02-12

166

一、在外链网址已屏蔽下载客户端,解压后并执行ant命令,在E:\tools\libs\fastdfs\fastdfs-client-java-master\src\build下会生成fastdfs_client.jar如图示 二、mvn安装fastdfs_client.jar,在cmd中执行命令mvn install:install-file -DgroupId=org.csource -Dar...

fastdfs-client-javajar1.27-SNAPSHOT.zip

05-29

Missing artifact org.csource:fastdfs-client-java:jar:1.27-SNAPSHOT

fastdfs两种java客户端的使用及踩坑

bcz1992的博客

11-29

2905

fastdfs两种java客户端的使用及踩坑

fastdfs两种java客户端的使用及踩坑

fastdfs官方给出了fastdfs-client-java,当然你可以直接将源码打成jar包上传到本地的maven仓库,如果你的maven clean install命令不是特别给力,一个劲报错,不嫌麻烦的话,可以直接在你的代码中引入源码(当然这种方式不是特别推荐),网上给出了几种客户端的使用,现在整理两种客户端的使用及出现的问题,供参考

基于com.github.tobato

你可以在maven中央仓库找到这个

fastdfs客户端操作(含客户端API源码编译)

技术黑板

06-13

1601

fastdfs-client-java操作fastdfs

一、下载源码编译:

在https://github.com/happyfish100/fastdfs-client-java下载客户端,

解压后并执行ant命令,

在E:\tools\libs\fastdfs\fastdfs-client-Java-master\src\build下会生成fastdfs_client.jar如图示...

fastdfs-client使用教程

springdata_的博客

07-10

6000

FastDfs客户端使用文档

fastdfs-client支持框架

fastdfs-client目前支持的框架有springboot1.x 、springboot2.x、springmvc

添加fastdfs-client依赖

springboot项目

项目pom.xml文件中增加jar包依赖

com.msun

fastdfs-client-springboot<

FastDFS-Client Java源码改造为适用Nacos的方式

Byppfeng的博客

01-16

1050

FastDFS-Client 源码的gitHub 地址:

https://github.com/happyfish100/fastdfs-client-java

这个Client的简单用法可自行去看博客:FastDFSClient集成SpringBoot 基础用法

简单用法主要是根据fdfs_client.conf 配置文件的配置来进行的,这样在打包发布后,配置文件不方便修改,对维护成本也有所增...

FastDFS-JAVA-Client使用示例

不以物喜的博客

08-30

751

JAVA实现对FastDFS的调用

0 概述

本文档主要用于在完成分布式FastDFS集群时,用java代码实现对FastDFS的调用,可以实现文件的上传、下载、删除、查看文件信息等功能。

1 前提条件

1) 已经完成了FastDFS分布式环境的搭建

若还没有搭建,请看我上一篇相关的文章《搭建分布式FastDFS集群》

2) 安装java软件并配置相应的路径

当前主机需要安装java,根据对应的主机类型下载不同的jdk版本,并配置好相应的java路径。https://www.runoob.com/java/

Java实现FastDFS客户端,包括加入读写锁

放学不要跑的博客

03-01

578

FastDFS 是一个轻量级的分布式文件系统,它提供了一个简单的接口,可以在不同的客户端上访问分布式文件系统。如果你需要在 FastDFS 的 Java 客户端中使用读写锁,可以使用 Java 中提供的 ReadWriteLock 接口来实现。ReadWriteLock 接口是一个支持读写分离的锁,它允许多个线程同时读取共享资源,但只允许一个线程写入共享资源

fastdfs java_fastdfs-client-java工具类的使用-Go语言中文社区

weixin_35881820的博客

02-22

386

FastDFS是通过StorageClient来执行上传操作的通过看源码我们知道,FastDFS有两个StorageClient工具类。StorageClient的上传方法upload_file(…)返回的是字符串数组String[],如[group1,M00/00/00/wKgAb1dBK2iANrayAA1rIuRd3Es112.jpg]StorageClient1的上传方法upload_fi...

FastDFS原理与过程解析

1 Byte 的博客

08-23

1894

前言:(上传和下载流程图详见:https://my.oschina.net/ydsakyclguozi/blog/403295)

(1)每次上传文件后都会返回一个地址,用户需要自己保存此地址。

(2)为了支持大容量,存储节点(服务器)采用了分卷(或分组)的组织方式。存储系统由一个或多个卷组成,卷与卷之间的文件是相互独立的,所有卷的文件容量累加就是整个存储系统中的文件容量。一个卷可以由一台或多台...

fastdfs-client-java:1.29-snapshot下载

最新发布

07-07

### 回答1:

要下载fastdfs-client-java:1.29-snapshot,可以按照以下步骤进行:

首先,打开一个可用的Web浏览器,例如Google Chrome或Mozilla Firefox。

在浏览器的搜索栏中输入“fastdfs-client-java:1.29-snapshot下载”进行搜索。

选择一个可靠的下载站点,例如GitHub或官方网站。

在下载站点上搜索fastdfs-client-java:1.29-snapshot,并找到对应的下载链接。

点击下载链接,将文件保存到本地计算机上的指定位置。

下载完成后,检查所下载文件的完整性和安全性。可以使用杀毒软件进行扫描,确保文件没有病毒或恶意软件。

解压下载的文件(如果有必要),并查看其中的文档或说明,以了解如何使用fastdfs-client-java:1.29-snapshot。

根据文档中的说明,将fastdfs-client-java:1.29-snapshot导入到项目中。

根据具体项目需求,配置和使用fastdfs-client-java:1.29-snapshot进行文件存储或处理操作。

需要注意的是,fastdfs-client-java:1.29-snapshot是一个开源的Java客户端库,用于与FastDFS分布式文件系统进行交互。它提供了一些API和方法,可以方便地在Java项目中使用FastDFS。在使用该库之前,确保了解FastDFS的基本原理和配置要求,以便正确地使用和配置fastdfs-client-java:1.29-snapshot。

### 回答2:

要下载fastdfs-client-java:1.29-snapshot,您可以按照以下步骤进行操作:

1. 打开您的网络浏览器,例如谷歌浏览器、火狐浏览器等。

2. 在搜索引擎中输入“fastdfs-client-java:1.29-snapshot下载”,然后按下Enter键。

3. 在搜索结果中,找到适合您系统版本的fastdfs-client-java:1.29-snapshot下载链接。

4. 单击该链接,可能会弹出文件下载对话框,您可以选择保存文件的位置。

5. 选择一个合适的文件保存位置,然后单击“保存”按钮。

6. 下载开始后,请耐心等待直到文件完成下载。

7. 下载完成后,您可以前往保存文件的位置查看下载的文件。

请注意,根据您的网络速度和服务器响应时间,下载过程可能需要一些时间。而且请确保从可信赖的网站下载文件,以确保文件的完整性和安全性。

### 回答3:

要下载fastdfs-client-java:1.29-snapshot,可以按照以下步骤进行操作:

1. 打开浏览器,进入FastDFS官方GitHub仓库的页面(https://github.com/happyfish100/fastdfs-client-java)。

2. 在页面上找到并点击"Code"按钮,然后选择"Download ZIP"选项,即可将整个代码库以zip压缩包的形式下载到本地。

3. 下载完成后,解压缩该zip压缩包,得到一个文件夹,里面包含了fastdfs-client-java的全部源代码。

4. 进入解压后的文件夹,可以看到该项目的源代码文件和相关配置文件。

5. 如果需要编译和构建项目,需要安装maven(https://maven.apache.org/),并在命令行中进入到该项目根目录下。

6. 使用maven命令进行项目构建,例如运行"mvn clean install"命令,该命令会下载所有依赖库并编译项目。

7. 若只需要使用已经编译好的jar包,则可以直接在该项目的GitHub页面上找到可用的jar包下载链接。

8. 点击下载链接,将fastdfs-client-java:1.29-snapshot的jar包保存到本地。

至此,你已经成功下载了fastdfs-client-java:1.29-snapshot。你可以将该jar包导入到你的Java项目中,以使用fastdfs-client-java提供的功能。需要注意的是,如果你在经过以上步骤后遇到了任何问题,建议查阅FastDFS官方文档或向FastDFS社区提问以获得更多帮助。

“相关推荐”对你有帮助么?

非常没帮助

没帮助

一般

有帮助

非常有帮助

提交

我是一个小仓鼠01

CSDN认证博客专家

CSDN认证企业博客

码龄3年

暂无认证

128

原创

6203

周排名

6万+

总排名

21万+

访问

等级

1419

积分

2万+

粉丝

93

获赞

16

评论

473

收藏

私信

关注

热门文章

七夕节表白3d相册制作

25492

关于IDEA的Spring boot项目创建慢,Maven插件加载慢,依赖导入慢或者失败的原因及解决方案

13937

常用工具类commons-io的学习使用

9243

Nacos配置中心(四)之Nacos集群

9127

可持续化扩展(一)之GitLab全局取消流水线

7005

分类专栏

HTML

5篇

JAVA语言

3篇

文件上传

5篇

GO语言

1篇

Spring

1篇

模板引擎

1篇

Vue

1篇

Api对接文档

4篇

java常用基础

6篇

GIt+SVN

3篇

搜索引擎

1篇

Nginx

1篇

扩展知识

3篇

开发框架

4篇

redis

8篇

MongoDB

6篇

MySQL

4篇

定时任务

2篇

SpringBoot

2篇

常用工具类

25篇

工作流

2篇

运维

8篇

Jenkins

11篇

Docker

10篇

Spring Cloud Alibaba

7篇

最新评论

Docker安装使用之安装(六)之安装MongoDB

qq_41656034:

引用「执行 mongo命令」

mongo 6.0版本改用mongosh

常用工具类joda-time使用详解

太空漫步11:

提一个建议,重复的代码可以封装成一个公共方法

Mysql学习(一)之Mysql的介绍和安装

jiankangfuzu:

请问安装时第一步,下载下来选择默认安装,不是11和图标吗,conn这四个驱动没有,什么原因?

常用工具类easypoi实现导入导出和生成Word

m0_64291558:

老哥,你这标题,不是word吗,我大致看了一下,没仔细看完,你这excel吧

Nacos配置中心(四)之Nacos集群

初冬的阳光:

nginx 成了单点

您愿意向朋友推荐“博客详情页”吗?

强烈不推荐

不推荐

一般般

推荐

强烈推荐

提交

最新文章

详细的IO面试题汇总

常用工具类之jasypt对mysql数据库配置进行账号密码加密

远程仓库(一)之git小乌龟 更换用户名和密码

2023年1篇

2022年127篇

目录

目录

分类专栏

HTML

5篇

JAVA语言

3篇

文件上传

5篇

GO语言

1篇

Spring

1篇

模板引擎

1篇

Vue

1篇

Api对接文档

4篇

java常用基础

6篇

GIt+SVN

3篇

搜索引擎

1篇

Nginx

1篇

扩展知识

3篇

开发框架

4篇

redis

8篇

MongoDB

6篇

MySQL

4篇

定时任务

2篇

SpringBoot

2篇

常用工具类

25篇

工作流

2篇

运维

8篇

Jenkins

11篇

Docker

10篇

Spring Cloud Alibaba

7篇

目录

评论

被折叠的  条评论

为什么被折叠?

到【灌水乐园】发言

查看更多评论

添加红包

祝福语

请填写红包祝福语或标题

红包数量

红包个数最小为10个

红包总金额

红包金额最低5元

余额支付

当前余额3.43元

前往充值 >

需支付:10.00元

取消

确定

下一步

知道了

成就一亿技术人!

领取后你会自动成为博主和红包主的粉丝

规则

hope_wisdom 发出的红包

实付元

使用余额支付

点击重新获取

扫码支付

钱包余额

0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值

java操作fdfs_fdfsoperationexception.java:29-CSDN博客

>

java操作fdfs_fdfsoperationexception.java:29-CSDN博客

java操作fdfs

最新推荐文章于 2023-05-30 00:23:48 发布

alenCook

最新推荐文章于 2023-05-30 00:23:48 发布

阅读量687

收藏

1

点赞数

分类专栏:

JAVA Other

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/PJF1501105594/article/details/109356109

版权

JAVA Other

专栏收录该内容

22 篇文章

0 订阅

订阅专栏

FIrst:POM

net.oschina.zcx7878

fastdfs-client-java

1.27.0.0

second:create Maven Project 并准备配置文件(来源:导入的pom包下有)

#这些配置是在http.conf里面 /etc/fdfs/

## fastdfs-client.properties

file_server_addr = 192.168.109.132:80

connect_timeout_in_seconds = 5

network_timeout_in_seconds = 30

charset = UTF-8

http_anti_steal_token = true

http_secret_key = FastDFS1234567890

http_tracker_http_port = 8080

tracker_server = 192.168.109.132:22122

##根据自己的环境配置

编写java操作fdfs工具类

import java.io.ByteArrayInputStream;

import java.io.ByteArrayOutputStream;

import java.io.IOException;

import java.io.InputStream;

import org.csource.common.MyException;

import org.csource.fastdfs.ClientGlobal;

import org.csource.fastdfs.FileInfo;

import org.csource.fastdfs.StorageClient;

import org.csource.fastdfs.StorageServer;

import org.csource.fastdfs.TrackerClient;

import org.csource.fastdfs.TrackerServer;

//初始化实例(tracker、storage)

public class FastDfsUtil {

private static TrackerClient trackerClient = null;

private static TrackerServer trackerServer = null;

private static StorageServer storageServer = null;

private static StorageClient storageClient = null;

static {

try {

ClientGlobal.init("fdfs_client.conf");

trackerClient = new TrackerClient();

trackerServer = trackerClient.getConnection();

storageClient = new StorageClient(trackerServer, storageServer);

} catch (Exception e) {

e.printStackTrace();

System.out.println("FDFS工具初始化失败!");

}

}

}

上传工具类方法

/**

* @Title: fdfsUpload

* @Description: 通过文件流上传文件

* @param @param inputStream 文件流

* @param @param filename 文件名称

* @param @throws IOException

* @param @throws MyException

* @return String 返回文件在FastDfs的存储路径

*/

public String fdfsUpload(InputStream inputStream, String filename) throws IOException, MyException{

String suffix = ""; //后缀名

try{

suffix = filename.substring(filename.lastIndexOf(".")+1);

}catch (Exception e) {

throw new RuntimeException("参数filename不正确!格式例如:a.png");

}

String savepath = ""; //FastDfs的存储路径

ByteArrayOutputStream swapStream = new ByteArrayOutputStream();

byte[] buff = new byte[1024];

int len = 0;

while ((len = inputStream.read(buff)) != -1) {

swapStream.write(buff, 0, len);

}

byte[] in2b = swapStream.toByteArray();

String[] strings = storageClient.upload_file(in2b, suffix, null); //上传文件

for (String str : strings) {

savepath += "/" + str; //拼接路径

}

return savepath;

}

/**

* @Title: fdfsUpload

* @Description: 本地文件上传

* @param @param filepath 本地文件路径

* @param @throws IOException

* @param @throws MyException

* @return String 返回文件在FastDfs的存储路径

*/

public static String fdfsUpload(String filepath) throws IOException, MyException{

String suffix = ""; //后缀名

try{

suffix = filepath.substring(filepath.lastIndexOf(".")+1);

}catch (Exception e) {

throw new RuntimeException("上传的不是文件!");

}

String savepath = ""; //FastDfs的存储路径

String[] strings = storageClient.upload_file(filepath, suffix, null); //上传文件

for (String str : strings) {

savepath += "/" + str; //拼接路径

}

return savepath;

}

下载方法

/**

* @Title: fdfsDownload

* @Description: 下载文件到目录

* @param @param savepath 文件存储路径

* @param @param localPath 下载目录

* @param @throws IOException

* @param @throws MyException

* @return boolean 返回是否下载成功

*/

public static boolean fdfsDownload(String savepath, String localPath) throws IOException, MyException{

String group = ""; //存储组

String path = ""; //存储路径

try{

int secondindex = savepath.indexOf("/", 2); //第二个"/"索引位置

group = savepath.substring(1, secondindex); //类似:group1

path = savepath.substring(secondindex + 1); //类似:M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png

}catch (Exception e) {

throw new RuntimeException("传入文件存储路径不正确!格式例如:/group1/M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png");

}

int result = storageClient.download_file(group, path, localPath);

if(result != 0){

throw new RuntimeException("下载文件失败:文件路径不对或者文件已删除!");

}

return true;

}

/**

* @Title: fdfsDownload

* @Description: 返回文件字符数组

* @param @param savepath 文件存储路径

* @param @throws IOException

* @param @throws MyException

* @return byte[] 字符数组

*/

public static byte[] fdfsDownload(String savepath) throws IOException, MyException{

byte[] bs = null;

String group = ""; //存储组

String path = ""; //存储路径

try{

int secondindex = savepath.indexOf("/", 2); //第二个"/"索引位置

group = savepath.substring(1, secondindex); //类似:group1

path = savepath.substring(secondindex + 1); //类似:M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png

}catch (Exception e) {

throw new RuntimeException("传入文件存储路径不正确!格式例如:/group1/M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png");

}

bs = storageClient.download_file(group, path); //返回byte数组

return bs;

}

删除文件服务器文件

/**

* @Title: fdfsDeleteFile

* @Description: 删除文件

* @param @param savepath 文件存储路径

* @param @throws IOException

* @param @throws MyException

* @return boolean 返回true表示删除成功

*/

public static boolean fdfsDeleteFile(String savepath) throws IOException, MyException{

String group = ""; //存储组

String path = ""; //存储路径

try{

int secondindex = savepath.indexOf("/", 2); //第二个"/"索引位置

group = savepath.substring(1, secondindex); //类似:group1

path = savepath.substring(secondindex + 1); //类似:M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png

}catch (Exception e) {

throw new RuntimeException("传入文件存储路径不正确!格式例如:/group1/M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png");

}

int result = storageClient.delete_file(group, path); //删除文件,0表示删除成功

if(result != 0){

throw new RuntimeException("删除文件失败:文件路径不对或者文件已删除!");

}

return true;

}

获取文件信息

/**

* @Title: fdfdFileInfo

* @Description: 返回文件信息

* @param @param savepath 文件存储路径

* @param @throws IOException

* @param @throws MyException

* @return FileInfo 文件信息

*/

public static FileInfo fdfdFileInfo(String savepath) throws IOException, MyException{

String group = ""; //存储组

String path = ""; //存储路径

try{

int secondindex = savepath.indexOf("/", 2); //第二个"/"索引位置

group = savepath.substring(1, secondindex); //类似:group1

path = savepath.substring(secondindex + 1); //类似:M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png

}catch (Exception e) {

throw new RuntimeException("传入文件存储路径不正确!格式例如:/group1/M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png");

}

FileInfo fileInfo = storageClient.get_file_info(group, path);

return fileInfo;

}

 

优惠劵

alenCook

关注

关注

0

点赞

1

收藏

觉得还不错?

一键收藏

知道了

0

评论

java操作fdfs

FIrst:POM<dependency> <groupId>net.oschina.zcx7878</groupId> <artifactId>fastdfs-client-java</artifactId> <version>1.27.0.0</version></dependency>second:create Maven Project 并准备配置文件(来源:导入

复制链接

扫一扫

专栏目录

fastdfs压测文档1

08-08

测试结果测试服务器:1.1硬件配置操作系统版本Cpu配置:双核内存配置16 G 空闲 155M上传测试10个并发上传测试前系统参数压测中系统峰值测试结果20个并

Java使用FastDFS

HueyLong的博客

08-22

3471

一、加载FastDFS的jar包

com.github.tobato

fastdfs-client

1.26.7

二、编写配置文件

fdfs:

connect-timeout: 30 # 连接的超时时间

参与评论

您还未登录,请先

登录

后发表或查看评论

FastDfs分布式文件系统集群搭建及Java客户端使用

sinat_32501475的博客

10-31

1357

FastDfs是一个开源高性能分布式文件系统。它的主要功能包括:文件存储、文件同步和文件访问(文件上传和文件下载),它可以解决高容量和负载平衡问题。FastDfs应满足基于照片共享网站和视频共享网站等文件的网站的要求。

分布式文件存储FastDFS

zzkeung的博客

08-19

2145

Table of Contents

1.FastDFS简介

FastDFS服务端两个角色

结构图

上传流程

2.FastDFS安装

运行tracker

运行storage

配置Nginx

3.业务实现

1.FastDFS简介

FastDFS是一个开源的分布式文件系统,她对文件进行管理,功能包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了大容量存储和负载均衡的问题。特别适合以文件为载体的在线服务,如相册网站、视频网站等等。

FastDFS服务端两个角...

FastDFS学习(二)

dengfengling999的博客

11-13

1129

在文件上传的时候,上传成功的信息中有提示我们可以通过某个路径去访问上传的文件,但是我们直接访问这个路径,却不可以,那么已经上传到FastDFS文件系统中的文件,我们如何在浏览器中访问呢?我们操作情况下,使用java操作的不是测试的命令:fdfs_test,操作的是正常的上传fdfs_upload_file等命令。首先上传一个文件:这个返回的结果信息很少,比上面的内容少很多,返回fileid:集群和远程文件地址。上面 上传的文件是不能直接访问的,需要使用Nginx的一个扩展插件。

java支持fdfs的jar包和上传代码

03-05

java支持fdfs的jar包和一份java upload测试代码 123456

fdfs-client:java的fastdfs客户端

06-19

fdfs-client fastdfs client for java. 本项目针对当前FastDFS最新版本V5.01,。

FastDFS文件操作-java

12-17

FastDFS文件操作-java,pom.xml引入依赖 net.oschina.zcx7878 fastdfs-client-java 1.27.0.0

fdfs-monitor:fdfs监视器

06-30

fdfs监视器 fdfs监视器

fdfs java客户端使用例子

10-27

fdfs java客户端使用例子,包含了上传,下载,删除,获取文件信息,获取文件元信息...

java操作fastdfs包括文件上传、下载、删除

m0_63040701的博客

05-30

1450

【代码】java操作fastdfs包括文件上传、下载、删除。

Java实现FastDFS客户端,包括加入读写锁

放学不要跑的博客

03-01

578

FastDFS 是一个轻量级的分布式文件系统,它提供了一个简单的接口,可以在不同的客户端上访问分布式文件系统。如果你需要在 FastDFS 的 Java 客户端中使用读写锁,可以使用 Java 中提供的 ReadWriteLock 接口来实现。ReadWriteLock 接口是一个支持读写分离的锁,它允许多个线程同时读取共享资源,但只允许一个线程写入共享资源

FastDFS压力测试

xiaofei0859的专栏

10-13

3507

使用FastDFS安装包中自带的工具进行测试,该工具是开源代码工具,可以根据自身情况进行修改。

测试步骤:

自带的工具是没有编译过的源码,需要进行编译生成测试脚本

首先解压FastDFS安装包

tar zxvf FastDFS_v5.03.tar.gz

进入测试脚本目录

cd FastDFS/test

编译

make 

make insta

分布式文件系统详解(安装、Java整合)—FastDFS

深圳市多克创新科技有限公司

03-30

1479

分布式文件系统—FastDFS

Fdfs环境搭建及整合Java

qq_40803115的博客

02-23

884

Fdfs环境搭建及整合Java

一、fdfs依赖安装

安装gcc(编译时需要)

FastDFS是C语言开发,安装FastDFS需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc

yum install -y gcc gcc-c++

安装libevent(运行时需求)

若安装了桌面图形界面,就不需要安装;FastDFS依赖libevent库;

yum -y install libevent

运行时路径:!!!!!

在linux文件系统我们需要新建两个目录,一个目录为我们

FastDFS搭建及java整合代码【转】

weixin_34128534的博客

10-25

172

FastDFS软件介绍1.什么是FastDFSFastDFS是用C语言编写的一款开源的分布式文件系统。FastDFS为互联网量身定制,充分考虑了冗余备份、负载均衡、线性扩容等机制,并注重高可用、高性能等指标,使用FastDFS很容易搭建一套高性能的文件服务器集群提供文件上传、下载等服务。2.FastDFS架构FastDFS架构包括 Tracker server和Storage server。客户端...

Java实现FastDFS对文件上传、下载、删除

ts977的博客

04-17

2913

实现Java通过FastDFS进行文件上传、下载、删除等

python将xls文件转换为csv格式

weixin_44342777的博客

04-18

1294

xls/xlsx转换成csv文件

【EXCEL】 python xls转csv

kkkyyyxxx的博客

11-27

1325

最近在整理气象数据,想把xls的数据转为csv格式方便后续用python进行shp的转化,故引出了这个问题。查看了相关资料,有两种方法可供选择,一种是按列,一种是按行,这个可以根据自己的数据来选择,记录如下。

java使用fdfs

最新发布

09-14

要使用Java操作FastDFS,你需要引入FastDFS的Java客户端库。可以使用Maven或者直接下载jar包的方式导入库文件。在pom.xml文件中添加以下依赖项:

```

net.oschina.zcx7878

fastdfs-client-java

1.27.0.0

```

然后,你需要编写一个Java工具类来操作FastDFS。可以参考以下代码:

```

import java.io.IOException;

import org.csource.common.MyException;

import org.csource.fastdfs.ClientGlobal;

import org.csource.fastdfs.FileInfo;

import org.csource.fastdfs.StorageClient;

import org.csource.fastdfs.StorageServer;

import org.csource.fastdfs.TrackerClient;

import org.csource.fastdfs.TrackerServer;

public class FastDfsUtil {

private static TrackerClient trackerClient = null;

private static TrackerServer trackerServer = null;

private static StorageServer storageServer = null;

private static StorageClient storageClient = null;

static {

try {

ClientGlobal.init("fdfs_client.conf");

trackerClient = new TrackerClient();

trackerServer = trackerClient.getConnection();

storageClient = new StorageClient(trackerServer, storageServer);

} catch (Exception e) {

e.printStackTrace();

System.out.println("FDFS工具初始化失败!");

}

}

public static FileInfo getFileInfo(String savepath) throws IOException, MyException {

String group = ""; // 存储组

String path = ""; // 存储路径

try {

int secondIndex = savepath.indexOf("/", 2); // 第二个"/"索引位置

group = savepath.substring(1, secondIndex); // 类似:group1

path = savepath.substring(secondIndex + 1); // 类似:M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png

} catch (Exception e) {

throw new RuntimeException("传入文件存储路径不正确!格式例如:/group1/M00/00/00/wKgBaFv9Ad-Abep_AAUtbU7xcws013.png");

}

FileInfo fileInfo = storageClient.get_file_info(group, path);

return fileInfo;

}

}

```

在上述代码中,我们使用FastDFS的Java客户端库,初始化一个TrackerClient、TrackerServer和StorageClient实例。然后,可以调用getFileInfo方法来获取文件信息,传入文件的存储路径作为参数。该方法会返回一个FileInfo对象,包含了文件的信息。

“相关推荐”对你有帮助么?

非常没帮助

没帮助

一般

有帮助

非常有帮助

提交

alenCook

博客等级

码龄9年

143

原创

38

点赞

136

收藏

15

粉丝

关注

私信

热门文章

Java接口继承接口

14003

SecureRandom--生成随机数

8777

elasticsearch启动

8276

Spring boot 访问template文件夹下的html

6886

导出-Excel- easypoi-ExcelExportUtil

6116

分类专栏

Flutter

1篇

springcloud

3篇

TS

1篇

odoo

linux

2篇

压缩学习成本系列

数学

1篇

AutoTest

2篇

Maven

9篇

Runtime

2篇

Thread

6篇

排序算法

1篇

密码学

3篇

二进制运算

1篇

机器学习

1篇

JAVA Other

22篇

Spring Boot

4篇

前端

22篇

Spring

2篇

数据库

10篇

书本相关内容

2篇

Redis

2篇

缓存

1篇

连接池

2篇

开发常用

30篇

题库

1篇

最新评论

Springboot启动一直卡在{dataSource-1} inited 如果你clean也没有效果请点看

是小c啊:

一直抛这个异常

[code=plain]

2023-08-09 10:01:13.570 ERROR 14524 --- [nio-8080-exec-2] com.alibaba.druid.pool.DruidDataSource : testWhileIdle is true, validationQuery not set

2023-08-09 10:01:13.586 INFO 14524 --- [nio-8080-exec-2] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited

[/code]

Springboot启动一直卡在{dataSource-1} inited 如果你clean也没有效果请点看

至尊玉_X:

idea运行没有问题,编程成jar包后

java -jar ****.jar报错

[2023-02-13 22:19:44,545][INFO][com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1928)] {dataSource-1} closed

js模拟ctrl+f功能

快乐的二进制鸭:

直接没效果啊??

Spring boot 访问template文件夹下的html

勇敢牛牛,不怕困难801:

老哥,为什么在配置文件中配备了项目名称就会访问不到,不配置的话就可以跳转,这是为啥呀

Spring boot 访问template文件夹下的html

a648x:

在stackoverflow上看到了,让重启,我重启idea又好了。。。

您愿意向朋友推荐“博客详情页”吗?

强烈不推荐

不推荐

一般般

推荐

强烈推荐

提交

最新文章

js模拟ctrl+f功能

json对象含有数组的比较相等

telliJ IDEA Serializable 无设置项Serializableclasswithout‘serialVersionUID’ 解决方式

2022年3篇

2021年15篇

2020年53篇

2019年74篇

2018年1篇

目录

目录

分类专栏

Flutter

1篇

springcloud

3篇

TS

1篇

odoo

linux

2篇

压缩学习成本系列

数学

1篇

AutoTest

2篇

Maven

9篇

Runtime

2篇

Thread

6篇

排序算法

1篇

密码学

3篇

二进制运算

1篇

机器学习

1篇

JAVA Other

22篇

Spring Boot

4篇

前端

22篇

Spring

2篇

数据库

10篇

书本相关内容

2篇

Redis

2篇

缓存

1篇

连接池

2篇

开发常用

30篇

题库

1篇

目录

评论

被折叠的  条评论

为什么被折叠?

到【灌水乐园】发言

查看更多评论

添加红包

祝福语

请填写红包祝福语或标题

红包数量

红包个数最小为10个

红包总金额

红包金额最低5元

余额支付

当前余额3.43元

前往充值 >

需支付:10.00元

取消

确定

下一步

知道了

成就一亿技术人!

领取后你会自动成为博主和红包主的粉丝

规则

hope_wisdom 发出的红包

实付元

使用余额支付

点击重新获取

扫码支付

钱包余额

0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值

百度知道 - 信息提示

百度知道 - 信息提示

百度首页

商城

注册

登录

网页

资讯

视频

图片

知道

文库

贴吧采购

地图更多

搜索答案

我要提问

百度知道>提示信息

知道宝贝找不到问题了>_

该问题可能已经失效。返回首页

15秒以后自动返回

帮助

 | 意见反馈

 | 投诉举报

京ICP证030173号-1   京网文【2023】1034-029号     ©2024Baidu  使用百度前必读 | 知道协议 

GitHub - ethan-yxchen/fsfsf: FSfSF - Fast Search for Similar Files

GitHub - ethan-yxchen/fsfsf: FSfSF - Fast Search for Similar Files

Skip to content

Toggle navigation

Sign in

Product

Actions

Automate any workflow

Packages

Host and manage packages

Security

Find and fix vulnerabilities

Codespaces

Instant dev environments

Copilot

Write better code with AI

Code review

Manage code changes

Issues

Plan and track work

Discussions

Collaborate outside of code

Explore

All features

Documentation

GitHub Skills

Blog

Solutions

For

Enterprise

Teams

Startups

Education

By Solution

CI/CD & Automation

DevOps

DevSecOps

Resources

Learning Pathways

White papers, Ebooks, Webinars

Customer Stories

Partners

Open Source

GitHub Sponsors

Fund open source developers

The ReadME Project

GitHub community articles

Repositories

Topics

Trending

Collections

Pricing

Search or jump to...

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

Sign up

You signed in with another tab or window. Reload to refresh your session.

You signed out in another tab or window. Reload to refresh your session.

You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

ethan-yxchen

/

fsfsf

Public

Notifications

Fork

0

Star

0

FSfSF - Fast Search for Similar Files

0

stars

0

forks

Branches

Tags

Activity

Star

Notifications

Code

Issues

0

Pull requests

0

Actions

Projects

0

Security

Insights

Additional navigation options

Code

Issues

Pull requests

Actions

Projects

Security

Insights

ethan-yxchen/fsfsf

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

 masterBranchesTagsGo to fileCodeFolders and filesNameNameLast commit messageLast commit dateLatest commit History17 Commitslibrarianlibrarian  readerreader  scannerscanner  README.mdREADME.md  document.cppdocument.cpp  files.pyfiles.py  flows.pyflows.py  proto1.pyproto1.py  setup.pysetup.py  tokenization.pyxtokenization.pyx  View all filesRepository files navigationREADMEFSFSF - Fast Search for Similar Files in a large collection of files

Manuscript of paper is in preparation; I will upload the code after I finish the writing

FSFSF searches for similar files and similar parts of files in a large-scale collection of files.

Mining for resemblance and containment of documents(Broder 1997) has long been important since the days of AltaVista, even before Google was born; search engine giants are doing really well nowaday, but there is not a simple, succinct open source project to address this problem and provide a general purpose module.

When we talk about similarity of two files, we are talking about that the two sets of features, extracted from the two files, has a large intersection. For example, depending on application, you may find that you consider two files similar as long as their bags of 2-grams are 80% intersected. This similarity is formally defined by Jaccard Distance.

And more than often, we may notice that just one part of a file is very similar to some other file, or a portion of the other file. A paragraph in an article can be similar to another paragraph in some other article, even if the articles are just 30% similar. Or a code block can be a near-clone to another code block in some other source file -- then you know maybe it's time for refactoring. Or when you identify a malicious attachment (payload) of a intentionally malformated PDF file, that payload might be found resemble to a payload in another cyberattack.

FSFSF solves these problems and empowers you to discvoer similarity relations within a large collections of files. You can do the following:

Given a collection of files, reporting approximately all pairs of similar files,

Or more efficiently, reporting clusters of similar files,

Or, for a single file, seen or unseen before, find almost every file similar to it. This is lightning fast, like Google's search image by image.

What's more, you can query for parts of files, without laborious effort to define and implement parsing of files into parts. It is an important advantage for unstructured files that you don't know how to parse, for semi-structured file, and for embedded contents (for example, suspicious string in javascript which can later be evaluated and reflected into code).

FSFSF is built on two ideas: Disjunction of Conjunction of Minhash (DC-Minhash) and File Fragment Clone Search (FFCS).

DC-Minhash provides a scalable, sort-and-groupby style clustering or pre-clustering algorithm. Sort-and-groupby approach is O(n log n) to the size of collection, and this is substantially faster then many clustering algorithms which requires O(n2) all-pair distance.

The vanila version of MinHash is a locality sensitiity hashing that use hamming distance among fix-size MinHash of as an estimater of Jaccard distance among sets. You still need to compute the distances when use. The first work which use the sort-and-groupby approach on MinHash is described in Cohen et al. (2001).

And if you look at the fuzzy digests widely adapt in practice, such as Nilsimsa hash, ssdeep, you also need to compute the distances. With appropirate overhead, DC-minhash can be a better choice when scale is really an issue.

About

FSfSF - Fast Search for Similar Files

Resources

Readme

Activity

Stars

0

stars

Watchers

2

watching

Forks

0

forks

Report repository

Releases

No releases published

Packages

0

No packages published

Languages

Python

58.0%

C++

42.0%

Footer

© 2024 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

【科研干货】空间分布函数SDF的计算及三维密度函数示意图 - 知乎

【科研干货】空间分布函数SDF的计算及三维密度函数示意图 - 知乎切换模式写文章登录/注册【科研干货】空间分布函数SDF的计算及三维密度函数示意图科研小然科研领域相关软件/知识/分享/如有学习计算需求欢迎咨询小然! ‍ :分子动力学模拟中常以径向分布函数(radical distribution function, RDF)来描述粒子周围环境的分布特性, 并表征其短程有序性. 分布函数的概念可推广到三维, 三维空间的分布函数被称为空间分布函数(spatial distribution function, SDF), 可定义为与粒子的局部数密度与平均数密度之比,数学实质是三维的某种密度分布。一般来讲, 三维密度函数的图示方法有好几种, 其中主要的几种在量子化学的轨道图示中都有使用过, 如点云图, 径向分布图, 角度分布图, 等值面图, 切面图. 此外还有几种图示方法是计算流体力学中常用的, 在化学中使用较少.计算方法SDF计算过程与具体体系相关, 不易统一, Gromacs提供了一个g_spatial的工具, 但使用不是很方便. 很多人使用gOpenMol, 如 Distrubutions of Counterions around DNA. Molecular Dynamics Simulations Results. 我没有使用过gOpenMol, 无法评论.下面是SDF的计算方法中心分子: 确定要分析的目标分子PBC平移: 将每一个目标分子平移至原点作为中心, 根据周期性边界条件(periodic boundary condition, PBC)对其他分子进行相应平移最佳叠合/旋转一致: 对PBC平移后的构型进行最佳叠合或旋转, 使中心分子取向一致统计密度: 利用中心分子取向一致后的构型统计其周围粒子的密度分布几点说明PBC平移的方法可参考我的博文取整截断函数及其在PBC中的使用。若每帧轨迹中含有N个目标分子, 则每帧轨迹最多可得到N个构型. 使用每个目标分子作为中心分子是为了充分利用每帧的数据, 如果你的轨迹文件时间很长, 每帧只使用一个中心分子也可以。最佳叠合/旋转一致过程我以前也简略说过. 如果中心分子在MD过程中构型变化不大, 或其关键部分是刚性的, 变化不大, 那么只要选择中心分子上不共线的三个原子, 第一个原子作原点, 第二个原子处于x轴正向, 第三个原子处于xy平面, z轴垂直于三个原子所在的平面, 将所有PBC平移后的构型都旋转至标准取向即可。严格来说, 应该对中心分子做最佳叠合, 使所有中心分子相对于参考中心分子的位置的偏差(RMSD)最小. 这不是一个简单的工作, 但可利用四元数方法解决。多个分子的叠合显示可利用Jmol或VMD. VMD支持的多帧XYZ文件, 原子类型及数目必须固定, 有时使用不便; Jmol支持的XYZ文件更宽泛, 但无法操控太大的文件。VMD处理大文件的能力很赞, 一百万个原子轻松, 再多点稍困难. 我最大操作四百万个原子, 比较卡了。统计密度时, 一般是使用直角坐标, 将整个空间分为若干均匀的小格子, 然后统计每个小格子中出现的原子个数, 再除以小格子的体积, 平均, 得到原子的数密度, 将此密度与平均密度相比, 得到SDF。统计密度时, 可只统计中心分子附近某一区域内的(可由RDF获知), 因离中心分子很远的地方SDF基本趋于均匀, 意义不大。一般需要对多帧轨迹进行计算统计, 直至算出的SDF数值收敛。一般将SDF保存为cube文件. cube文件格式始于Gaussian, 但现在已基本成为标准格式了。cube文件的可视化程序很多, 大凡好点的分子可视化程序都支持, 常用的如GaussView, VMD, Jmol, ChemCraft, Chemirea, gOpenmol. 如果要同时显示多个等值面, GaussView可能不是一个好的选择, VMD可能最简单, 具体方法可参考 VMD 画cube文件等密度面图(轨道或电子密度等)代码CntAtmRotMolSDF示例如下:以一帧含5000个水分子的构型为例, 计算水分子周围O原子的SDF目标分子, 水分子, 此帧5000个2.以每个水分子为中心, 其余水分子PBC平移至[-L/2, L/2]范围内, 共得5000个构型. 其中一个如下图3.将中心水分子进行叠加显示, 可见最佳叠合/旋转一致前, 由于取向随机, 中心O原子周围H原子基本成球状分布, 中心水分子周围其他水分子分布也呈均匀分布4.将中心水分子旋转一致后, 中心O原子周围H原子分布与单个水分子类似, 但由于水分子构型在MD过程中有变化, 不会完全重合5.旋转一致后, 中心水分子周围其他水分子的分布不再均匀, 显示出各向异性, 这种各向异性从叠合后的构型图也可看出,O原子分布。H原子分布水分子分布6.计算cube文件, 利用VMD显示等值面, 两个不同值的等值面(蓝色为5, 红色为10)如下, 水分子周围H氢键的四面体结构很明显如下图:发布于 2022-06-09 16:12​赞同​​添加评论​分享​喜欢​收藏​申请

使用 FileSystem JAVA API 对 HDFS 进行读、写、删除等操作_filesystems java-CSDN博客

>

使用 FileSystem JAVA API 对 HDFS 进行读、写、删除等操作_filesystems java-CSDN博客

使用 FileSystem JAVA API 对 HDFS 进行读、写、删除等操作

最新推荐文章于 2023-05-12 19:18:45 发布

wisgood

最新推荐文章于 2023-05-12 19:18:45 发布

阅读量2.4w

收藏

7

点赞数

1

分类专栏:

MapReduce

MapReduce

专栏收录该内容

69 篇文章

3 订阅

订阅专栏

Hadoop文件系统  基本的文件系统命令操作, 通过hadoop fs -help可以获取所有的命令的详细帮助文件。  Java抽象类org.apache.hadoop.fs.FileSystem定义了hadoop的一个文件系统接口。该类是一个抽象类,通过以下两种静态工厂方法可以过去FileSystem实例:  public static FileSystem.get(Configuration conf) throws IOException  public static FileSystem.get(URI uri, Configuration conf) throws IOException  具体方法实现:  1、public boolean mkdirs(Path f) throws IOException  一次性新建所有目录(包括父目录), f是完整的目录路径。  2、public FSOutputStream create(Path f) throws IOException  创建指定path对象的一个文件,返回一个用于写入数据的输出流  create()有多个重载版本,允许我们指定是否强制覆盖已有的文件、文件备份数量、写入文件缓冲区大小、文件块大小以及文件权限。  3、public boolean copyFromLocal(Path src, Path dst) throws IOException  将本地文件拷贝到文件系统  4、public boolean exists(Path f) throws IOException  检查文件或目录是否存在  5、public boolean delete(Path f, Boolean recursive)  永久性删除指定的文件或目录,如果f是一个空目录或者文件,那么recursive的值就会被忽略。只有recursive=true时,一个非空目录及其内容才会被删除。  6、FileStatus类封装了文件系统中文件和目录的元数据,包括文件长度、块大小、备份、修改时间、所有者以及权限信息。 

通过"FileStatus.getPath()"可查看指定HDFS中某个目录下所有文件。 

01 package hdfsTest;

02  

03 import java.io.IOException;

04  

05 import org.apache.hadoop.conf.Configuration;

06 import org.apache.hadoop.fs.FSDataOutputStream;

07 import org.apache.hadoop.fs.FileStatus;

08 import org.apache.hadoop.fs.FileSystem;

09 import org.apache.hadoop.fs.Path;

10  

11 public class OperatingFiles {

12     //initialization

13     static Configuration conf = new Configuration();

14     static FileSystem hdfs;

15     static {

16         String path = "/usr/java/hadoop-1.0.3/conf/";

17         conf.addResource(new Path(path + "core-site.xml"));

18         conf.addResource(new Path(path + "hdfs-site.xml"));

19         conf.addResource(new Path(path + "mapred-site.xml"));

20         path = "/usr/java/hbase-0.90.3/conf/";

21         conf.addResource(new Path(path + "hbase-site.xml"));

22         try {

23             hdfs = FileSystem.get(conf);

24         } catch (IOException e) {

25             e.printStackTrace();

26         }

27     }

28      

29     //create a direction

30     public void createDir(String dir) throws IOException {

31         Path path = new Path(dir);

32         hdfs.mkdirs(path);

33         System.out.println("new dir \t" + conf.get("fs.default.name") + dir);

34     }  

35      

36     //copy from local file to HDFS file

37     public void copyFile(String localSrc, String hdfsDst) throws IOException{

38         Path src = new Path(localSrc);     

39         Path dst = new Path(hdfsDst);

40         hdfs.copyFromLocalFile(src, dst);

41          

42         //list all the files in the current direction

43         FileStatus files[] = hdfs.listStatus(dst);

44         System.out.println("Upload to \t" + conf.get("fs.default.name") + hdfsDst);

45         for (FileStatus file : files) {

46             System.out.println(file.getPath());

47         }

48     }

49      

50     //create a new file

51     public void createFile(String fileName, String fileContent) throws IOException {

52         Path dst = new Path(fileName);

53         byte[] bytes = fileContent.getBytes();

54         FSDataOutputStream output = hdfs.create(dst);

55         output.write(bytes);

56         System.out.println("new file \t" + conf.get("fs.default.name") + fileName);

57     }

58      

59     //list all files

60     public void listFiles(String dirName) throws IOException {

61         Path f = new Path(dirName);

62         FileStatus[] status = hdfs.listStatus(f);

63         System.out.println(dirName + " has all files:");

64         for (int i = 0; i< status.length; i++) {

65             System.out.println(status[i].getPath().toString());

66         }

67     }

68  

69     //judge a file existed? and delete it!

70     public void deleteFile(String fileName) throws IOException {

71         Path f = new Path(fileName);

72         boolean isExists = hdfs.exists(f);

73         if (isExists) { //if exists, delete

74             boolean isDel = hdfs.delete(f,true);

75             System.out.println(fileName + "  delete? \t" + isDel);

76         } else {

77             System.out.println(fileName + "  exist? \t" + isExists);

78         }

79     }

80  

81     public static void main(String[] args) throws IOException {

82         OperatingFiles ofs = new OperatingFiles();

83         System.out.println("\n=======create dir=======");

84         String dir = "/test";

85         ofs.createDir(dir);

86         System.out.println("\n=======copy file=======");

87         String src = "/home/ictclas/Configure.xml";

88         ofs.copyFile(src, dir);

89         System.out.println("\n=======create a file=======");

90         String fileContent = "Hello, world! Just a test.";

91         ofs.createFile(dir+"/word.txt", fileContent);

92     }

93 }

Using HDFS in java (0.20.0)

Below is a code sample of how to read from and write to HDFS in java. 

1. Creating a configuration object:  

To be able to read from or write to HDFS, you need to create a Configuration object and pass configuration parameter to it using hadoop configuration files.  

  

    // Conf object will read the HDFS configuration parameters from these 

 XML     // files. You may specify the parameters for your own if you want. 

    Configuration conf = new Configuration(); 

    conf.addResource(new Path("/opt/hadoop-0.20.0/conf/core-site.xml")); 

    conf.addResource(new Path("/opt/hadoop-0.20.0/conf/hdfs-site.xml")); 

    If you do not assign the configurations to conf object (using hadoop xml file) your HDFS operation will be performed on the local file system and not on the HDFS. 

2. Adding file to HDFS: Create a FileSystem object and use a file stream to add a file. 

    FileSystem fileSystem = FileSystem.get(conf);          // Check if the file already exists     Path path = new Path("/path/to/file.ext");     if (fileSystem.exists(path)) {         System.out.println("File " + dest + " already exists");         return;     }     // Create a new file and write data to it.     FSDataOutputStream out = fileSystem.create(path);     InputStream in = new BufferedInputStream(new FileInputStream(         new File(source)));     byte[] b = new byte[1024];     int numBytes = 0;     while ((numBytes = in.read(b)) > 0) {         out.write(b, 0, numBytes);     }     // Close all the file descripters     in.close();     out.close();     fileSystem.close();

3. Reading file from HDFS: Create a file stream object to a file in HDFS and read it. 

    FileSystem fileSystem = FileSystem.get(conf);     Path path = new Path("/path/to/file.ext"); 

    if (!fileSystem.exists(path)) { 

        System.out.println("File does not exists"); 

        return; 

    }     FSDataInputStream in = fileSystem.open(path); 

    String filename = file.substring(file.lastIndexOf('/') + 1,         file.length()); 

    OutputStream out = new BufferedOutputStream(new FileOutputStream(         new File(filename))); 

    byte[] b = new byte[1024]; 

    int numBytes = 0; 

    while ((numBytes = in.read(b)) > 0) { 

        out.write(b, 0, numBytes); 

    } 

    in.close(); 

    out.close(); 

    fileSystem.close(); 

3. Deleting file from HDFS: Create a file stream object to a file in HDFS and delete it. 

    FileSystem fileSystem = FileSystem.get(conf); 

    Path path = new Path("/path/to/file.ext"); 

    if (!fileSystem.exists(path)) { 

        System.out.println("File does not exists"); 

        return; 

    }     // Delete file     fileSystem.delete(new Path(file), true); 

    fileSystem.close(); 

3. Create dir in HDFS: Create a file stream object to a file in HDFS and read it. 

    FileSystem fileSystem = FileSystem.get(conf); 

    Path path = new Path(dir); 

    if (fileSystem.exists(path)) { 

        System.out.println("Dir " + dir + " already not exists"); 

        return; 

    }     // Create directories     fileSystem.mkdirs(path); 

    fileSystem.close(); 

Code:

001 import java.io.BufferedInputStream;

002 import java.io.BufferedOutputStream;

003 import java.io.File;

004 import java.io.FileInputStream;

005 import java.io.FileOutputStream;

006 import java.io.IOException;

007 import java.io.InputStream;

008 import java.io.OutputStream;

009  

010 import org.apache.hadoop.conf.Configuration;

011 import org.apache.hadoop.fs.FSDataInputStream;

012 import org.apache.hadoop.fs.FSDataOutputStream;

013 import org.apache.hadoop.fs.FileSystem;

014 import org.apache.hadoop.fs.Path;

015  

016 public class HDFSClient {

017     public HDFSClient() {

018  

019     }

020  

021     public void addFile(String source, String dest) throws IOException {

022         Configuration conf = new Configuration();

023  

024         // Conf object will read the HDFS configuration parameters from these

025         // XML files.

026         conf.addResource(new Path("/opt/hadoop-0.20.0/conf/core-site.xml"));

027         conf.addResource(new Path("/opt/hadoop-0.20.0/conf/hdfs-site.xml"));

028  

029         FileSystem fileSystem = FileSystem.get(conf);

030  

031         // Get the filename out of the file path

032         String filename = source.substring(source.lastIndexOf('/') + 1,

033             source.length());

034  

035         // Create the destination path including the filename.

036         if (dest.charAt(dest.length() - 1) != '/') {

037             dest = dest + "/" + filename;

038         } else {

039             dest = dest + filename;

040         }

041  

042         // System.out.println("Adding file to " + destination);

043  

044         // Check if the file already exists

045         Path path = new Path(dest);

046         if (fileSystem.exists(path)) {

047             System.out.println("File " + dest + " already exists");

048             return;

049         }

050  

051         // Create a new file and write data to it.

052         FSDataOutputStream out = fileSystem.create(path);

053         InputStream in = new BufferedInputStream(new FileInputStream(

054             new File(source)));

055  

056         byte[] b = new byte[1024];

057         int numBytes = 0;

058         while ((numBytes = in.read(b)) > 0) {

059             out.write(b, 0, numBytes);

060         }

061  

062         // Close all the file descripters

063         in.close();

064         out.close();

065         fileSystem.close();

066     }

067  

068     public void readFile(String file) throws IOException {

069         Configuration conf = new Configuration();

070         conf.addResource(new Path("/opt/hadoop-0.20.0/conf/core-site.xml"));

071  

072         FileSystem fileSystem = FileSystem.get(conf);

073  

074         Path path = new Path(file);

075         if (!fileSystem.exists(path)) {

076             System.out.println("File " + file + " does not exists");

077             return;

078         }

079  

080         FSDataInputStream in = fileSystem.open(path);

081  

082         String filename = file.substring(file.lastIndexOf('/') + 1,

083             file.length());

084  

085         OutputStream out = new BufferedOutputStream(new FileOutputStream(

086             new File(filename)));

087  

088         byte[] b = new byte[1024];

089         int numBytes = 0;

090         while ((numBytes = in.read(b)) > 0) {

091             out.write(b, 0, numBytes);

092         }

093  

094         in.close();

095         out.close();

096         fileSystem.close();

097     }

098  

099     public void deleteFile(String file) throws IOException {

100         Configuration conf = new Configuration();

101         conf.addResource(new Path("/opt/hadoop-0.20.0/conf/core-site.xml"));

102  

103         FileSystem fileSystem = FileSystem.get(conf);

104  

105         Path path = new Path(file);

106         if (!fileSystem.exists(path)) {

107             System.out.println("File " + file + " does not exists");

108             return;

109         }

110  

111         fileSystem.delete(new Path(file), true);

112  

113         fileSystem.close();

114     }

115  

116     public void mkdir(String dir) throws IOException {

117         Configuration conf = new Configuration();

118         conf.addResource(new Path("/opt/hadoop-0.20.0/conf/core-site.xml"));

119  

120         FileSystem fileSystem = FileSystem.get(conf);

121  

122         Path path = new Path(dir);

123         if (fileSystem.exists(path)) {

124             System.out.println("Dir " + dir + " already not exists");

125             return;

126         }

127  

128         fileSystem.mkdirs(path);

129  

130         fileSystem.close();

131     }

132  

133     public static void main(String[] args) throws IOException {

134  

135         if (args.length < 1) {

136             System.out.println("Usage: hdfsclient add/read/delete/mkdir" +

137                 " [ ]");

138             System.exit(1);

139         }

140  

141         HDFSClient client = new HDFSClient();

142         if (args[0].equals("add")) {

143             if (args.length < 3) {

144                 System.out.println("Usage: hdfsclient add " +

145                 "");

146                 System.exit(1);

147             }

148  

149             client.addFile(args[1], args[2]);

150         } else if (args[0].equals("read")) {

151             if (args.length < 2) {

152                 System.out.println("Usage: hdfsclient read ");

153                 System.exit(1);

154             }

155  

156             client.readFile(args[1]);

157         } else if (args[0].equals("delete")) {

158             if (args.length < 2) {

159                 System.out.println("Usage: hdfsclient delete ");

160                 System.exit(1);

161             }

162  

163             client.deleteFile(args[1]);

164         } else if (args[0].equals("mkdir")) {

165             if (args.length < 2) {

166                 System.out.println("Usage: hdfsclient mkdir ");

167                 System.exit(1);

168             }

169  

170             client.mkdir(args[1]);

171         } else {  

172             System.out.println("Usage: hdfsclient add/read/delete/mkdir" +

173                 " [ ]");

174             System.exit(1);

175         }

176  

177         System.out.println("Done!");

178     }

179 }

from:http://smallwildpig.iteye.com/blog/1705039   Java对HDFS的操作

http://blog.rajeevsharma.in/2009/06/using-hdfs-in-java-0200.html   Using HDFS in java (0.20.0)

优惠劵

wisgood

关注

关注

1

点赞

7

收藏

觉得还不错?

一键收藏

知道了

2

评论

使用 FileSystem JAVA API 对 HDFS 进行读、写、删除等操作

Hadoop文件系统 基本的文件系统命令操作, 通过hadoop fs -help可以获取所有的命令的详细帮助文件。 Java抽象类org.apache.hadoop.fs.FileSystem定义了hadoop的一个文件系统接口。该类是一个抽象类,通过以下两种静态工厂方法可以过去FileSystem实例: public static FileSystem.get(Configur

复制链接

扫一扫

专栏目录

FileSystem:用Java从头开始编写的文件系统API的实现

05-05

文件系统 用Java从头开始编写的文件系统API的实现 ... FileSystemClientAPI.java使用FileBuffer.java从服务器缓存文件的1KB块。 当FileSystemClientAPI请求的偏移量超出缓存范围时,将更新缓存并返回正确的数据。

java进阶笔记之Paths与FileSystems

huitoukest的专栏

06-24

2338

简介

Paths中封装了活动Path的工具方法 , 其实现默认依赖于FileSystems , 是Path操作的增强工具类.

使用Paths时会使用FileSystem默认的文件分隔符操作.

ps: 在win 系统中 同样支持 " / " 文件分隔符 .

FileSystems FileSystem的工厂类, 主要是提供了系统常用的文件系统的快捷方法, 并且支持加载自定义的文件系统.

示例

import org.junit.Test;

import java.io.IOException;

i

2 条评论

您还未登录,请先

登录

后发表或查看评论

优雅的操作文件:java.nio.file 库介绍

Gefangenes的博客

05-12

791

缺乏对现代文件系统的支持:只提供的基础的文件操作,不支持很多现代的文件系统API 不够直观:文件操作的 API 设计相对较为复杂和冗长,使用体验感很差对于大文件处理和并发性能不够:简单的 I/O 模型,没有充分利用现代硬件的性能优势,而且还有很多同步的问题但 Java 在后期版本中引入了库来提高 Java 对文件操作的能力。还增加的流的功能,似乎使得文件变成更好用了。所以本章,我们就来主要介绍Path 路径:Paths 模块和 Path 工具类介绍。

Java NIO 文件系统:FileSystem类

weixin_38569499的博客

12-13

4825

    FileSystem类提供文件系统的接口,是用于访问文件系统中的文件和其他对象的工厂类。

1、FileSystem实例的获取:

    FileSystem定义了protected权限的构造器,所以用户不能通过new关键字直接构造FileSystem的实例。在FileSystems类中,定义了一系列获取FileSystem实例的方法:

    1)getDefault():返回默认的...

Hadoop - HDFS(体系结构介绍、HDFS数据处理、Hadoop Shell基本操作、HDFS Java API)

坚决不做秃头少女

12-26

690

* HDFS的工作原理是答辩重点(块、元数据、主/从节点SecondaryNameNode,FsImage、EditImage、存取策略/规则、数据出错与恢复、读写过程)

集群和分布式概念:

集群:集群就是逻辑上处理同一任务的机器集合,可以属于同一机房,也可分属不同的机房

分布式:分布式文件系统把文件分布存储到多个计算机节点上,成千上万的计算机节点构成计算机集群

集群就是逻辑上处理同一任...

hadoop深入研究:(二)——java访问hdfs

热门推荐

独自登高楼 望断天涯路

06-03

1万+

转载请注明出处,http://blog.csdn.net/lastsweetop/article/details/9001467所有源码在github上,https://github.com/lastsweetop/styhadoop读数据使用hadoop url读取比较简单的读取hdfs数据的方法就是通过java.net.URL打开一个流,不过在这之前先要预先调用它的setURLStreamHa

java大数据作业_2HDFS

01-23

1.如何检测损坏的文件,以及对文件系统进行日常检查 2.添加节点如何优化数据平衡时的数据风暴 3.如何合并碎小的文件,为什么要这么做? 4.简述Hadoop集群的心跳机制 5.哪个类可以过滤HDFS读取的路径 6.编写一个程序...

HDFS判断文件或目录是否存在——Shell命令实现 + Java代码实现

01-20

hdfs dfs -test -e 文件或目录名 第三步,查看检测结果: echo $? 若输出结果为0,则说明文件或目录存在,若为1,则说明文件或目录不存在。 二、Java代码实现 import org.apache.hadoop.conf.Configuration; ...

10hdfsapi第一个案例

01-20

hdfsapi第一个案例(先创建一个包) 解决用户权限问题、获取操作对象的6种方式 以下方法是修改用户权限的操作 权限问题: 解决用户出错的几种方案: vm options: -DHADOOP_USER_NAME=root 2、设置系统环境...

基于HTML5 FileSystem API的使用介绍

09-28

HTML5的强大之一就是允许web程序申请一些临时或者永久的空间(Quota)在这里可以进行数据的存储甚至文件的操作

Hadoop大数据开发基础系列:五、MapReduce进阶编程

Nelson_hehe的博客

10-18

4887

五、MapReduce进阶编程

目录:

1.筛选日志文件并生成序列化文件

2.HadoopJavaAPI读取序列化日志文件

3.优化日志文件统计程序

4.Eclipse提交日志文件统计程序

5.小结

6.实训

7.小练习

任务背景:网站运营方又提出来新的需求,为了比较今年与去年同期的用户访问数据,要求分别统计出2016年1月与2月的用户访问次数,并输出到不同的目录中。在本章中...

Java创建hdfs文件实例

on the way的专栏

07-12

4235

1.创建文件

过"FileSystem.create(Path f)"可在HDFS上创建文件,其中f为文件的完整路径。

package com.hebut.file;

import org.apache.hadoop.conf.Configuration;

   

import org.apache.hadoop.fs.FSDataOutputStream;

 

(八)java.nio.file.FileSystem类详解

OceanSky的专栏

02-23

8146

抽象类FileSystem简介:

public abstract class FileSystem extends Object implements Closeable类

为文件系统提供一个接口,是对象访问文件系统中的文件和其它对象的工厂类。

默认的文件系统,通过调用FileSystems.getDefault 方法,提供访问java虚拟机的文件系统,FileSystems类定义方法创建文...

使用Java API操作HDFS

ZYF2190003497的博客

11-26

916

了解HDFS java API

HDFS(12)--HDFS的javaAPI操作

kismet

11-12

1996

创建maven工程并导入jar包

cloudera

https://repository.cloudera.com/artifactory/cloudera-repos/

&...

JAVA操作HDFS API(hadoop)

weixin_30532369的博客

06-06

121

HDFS API详解

  Hadoop中关于文件操作类基本上全部是在"org.apache.hadoop.fs"包中,这些API能够支持的操作包含:打开文件,读写文件,删除文件等。

Hadoop类库中最终面向用户提供的接口类是FileSystem,该类是个抽象类,只能通过来类的get方法得到具体类。get方法存在几个重载版本,常用的是这个:

static FileSystem ...

使用Java API操作HDFS(二)

weixin_64270471的博客

12-14

694

接上节创建hadoop.txt能否事先判断文件是否存在呢?我们去查看Hadoop FileSystem API文档查看方法编写create2()方法,事先判断文件是否存在运行程序故意让HDFS进入安全模式(只能读,不能写),看看会出现什么状况?删除已经创建的此时,再运行程序,查看结果,抛出异常下面,修改程序,来处理这个可能会抛出的安全模式异常运行程序,查看结果(虽然我们捕获了安全模式异常,但还是有一点系统抛出的异常信息)再运行程序,查看效果。

记一次因权限问题无法删除hdfs文件的解决办法

萌兔兔MMQ!!

03-26

950

报错如下截图:

首先登陆集群节点服务器:

进入集群hdfs存储文件路径,操作执行

sudo -uhdfs hdfs fs -rm -r /usr/keyword/class/input

因文件夹已删除无法演示,请参考以上命令行。

sudo -uhdfs hdfs dfs -rm -r /volte

...

java 文件系统格式_java11教程--类FileSystems用法

weixin_42525106的博客

02-24

673

文件系统的工厂方法。此类定义getDefault方法以获取默认文件系统和工厂方法以构造其他类型的文件系统。第一次调用此类定义的任何方法都会导致加载默认值provider 。 由URI方案“file”标识的默认提供程序创建FileSystem ,该提供程序提供对Java虚拟机可访问的文件系统的访问。 如果加载或初始化默认提供程序的过程失败,则会引发未指定的错误。第一次调用installedProvi...

hdfs java api 读写文件操作_HDFS教程:使用Java API读写命令

最新发布

05-28

好的,让我来回答您的问题。

使用Java API读写HDFS文件,需要进行以下步骤:

1. 创建Configuration对象,并设置HDFS的URI和文件系统类型。

```java

Configuration conf = new Configuration();

conf.set("fs.defaultFS", "hdfs://localhost:9000");

conf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName());

```

2. 获取FileSystem对象,并指定使用的文件系统类型。

```java

FileSystem fs = FileSystem.get(conf);

```

3. 创建Path对象,指定读写的HDFS文件路径。

```java

Path filePath = new Path("/user/hadoop/test.txt");

```

4. 使用FSDataInputStream读取HDFS文件内容。

```java

FSDataInputStream inStream = fs.open(filePath);

byte[] buffer = new byte[256];

int bytesRead = 0;

while ((bytesRead = inStream.read(buffer)) > 0) {

System.out.println(new String(buffer, 0, bytesRead));

}

inStream.close();

```

5. 使用FSDataOutputStream写入HDFS文件内容。

```java

FSDataOutputStream outStream = fs.create(filePath);

outStream.writeBytes("Hello, world!");

outStream.close();

```

以上就是使用Java API读写HDFS文件的基本步骤。希望能够帮助到您!

“相关推荐”对你有帮助么?

非常没帮助

没帮助

一般

有帮助

非常有帮助

提交

wisgood

CSDN认证博客专家

CSDN认证企业博客

码龄13年

暂无认证

166

原创

1万+

周排名

57万+

总排名

278万+

访问

等级

2万+

积分

1206

粉丝

515

获赞

188

评论

1160

收藏

私信

关注

热门文章

Hive函数大全

169736

Jps命令—使用详解

80175

JVM性能调优监控工具jps、jstack、jmap、jhat、jstat使用详解

63048

Linux du命令和df命令区别

52820

Hive 中内部表与外部表的区别与创建方法

51589

分类专栏

Flink

1篇

Hadoop从入门到放弃

7篇

开源社区贡献

2篇

MapReduce

69篇

Hive

93篇

spark

65篇

Java

102篇

Yarn

5篇

Linux

84篇

数据仓库

8篇

大数据运维

6篇

Hbase

4篇

算法

22篇

Pig

3篇

mysql

10篇

tez

3篇

docker

1篇

HDFS

7篇

编程工具

8篇

scala

9篇

kafka

15篇

最新评论

多年大数据开发经验总结

菜码代码:

现在呢,都没什么公司用了

flink回撤流分析

CSDN-Ada助手:

非常感谢您分享关于flink回撤流分析的博客,这篇文章对于正在学习和使用flink的开发者来说非常有帮助。我觉得下一篇博客可以继续探讨flink的流处理能力,在实际场景中如何应用flink实现数据处理和分析,建议您可以写一篇关于“flink实时数据处理的最佳实践”或“flink在大数据分析中的应用”等主题,相信会有更多读者受益。期待您的下一篇分享!

为了方便博主创作,提高生产力,CSDN上线了AI写作助手功能,就在创作编辑器右侧哦~(https://mp.csdn.net/edit?utm_source=blog_comment_recall )诚邀您来加入测评,到此(https://activity.csdn.net/creatActivity?id=10450&utm_source=blog_comment_recall)发布测评文章即可获得「话题勋章」,同时还有机会拿定制奖牌。

hive中join导致的数据倾斜问题排查

wennwennn:

可能其他大key分到其他reduce,大家都慢,就不倾斜了

hive 使用lzo遇到的一个奇怪的问题

code学习社:

请问一下问题解决了,可以告知一下解决方法吗,感谢

如何确定Kafka的分区数、key和consumer线程数

打破砂锅问到底007:

谢谢分享。

默认情况下, kafka 是根据 key 来分配消息到哪个 topic的分区的,这样就可以实现某一台消费者机器都是同一个 key的消息,也就是这个 key的消息只会到 同一个机器上,这对 想保证一定顺序性需求的同学是有帮助的

您愿意向朋友推荐“博客详情页”吗?

强烈不推荐

不推荐

一般般

推荐

强烈推荐

提交

最新文章

flink回撤流分析

hive 的 left semi join 讲解

sparksql通过jdbc读取mysql时划分分区问题

2022年1篇

2019年1篇

2018年20篇

2017年26篇

2016年87篇

2015年49篇

2014年130篇

2013年209篇

2012年6篇

2011年2篇

目录

目录

分类专栏

Flink

1篇

Hadoop从入门到放弃

7篇

开源社区贡献

2篇

MapReduce

69篇

Hive

93篇

spark

65篇

Java

102篇

Yarn

5篇

Linux

84篇

数据仓库

8篇

大数据运维

6篇

Hbase

4篇

算法

22篇

Pig

3篇

mysql

10篇

tez

3篇

docker

1篇

HDFS

7篇

编程工具

8篇

scala

9篇

kafka

15篇

目录

评论 2

被折叠的  条评论

为什么被折叠?

到【灌水乐园】发言

查看更多评论

添加红包

祝福语

请填写红包祝福语或标题

红包数量

红包个数最小为10个

红包总金额

红包金额最低5元

余额支付

当前余额3.43元

前往充值 >

需支付:10.00元

取消

确定

下一步

知道了

成就一亿技术人!

领取后你会自动成为博主和红包主的粉丝

规则

hope_wisdom 发出的红包

实付元

使用余额支付

点击重新获取

扫码支付

钱包余额

0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值

How to pronounce Fsdfsfs | HowToPronounce.com

How to pronounce Fsdfsfs | HowToPronounce.com

Dictionary

Collections

Quiz

Community

Contribute

Certificate

WEBSITE LANGUAGE

English

Deutsch

Español

Français

Italiano

Magyar

Nederlands

Polski

Português

Pусский

Română

Svenska

Türkçe

čeština

Ελληνικά

עִברִית

中文

日本人

No results found

{{app.scroll_content}}

How to pronounce Fsdfsfs?

English

Pronounce

Collections

Quiz

All Languages

{{app['fromLang']['value']}} -> {{app['toLang']['value']}}

{{app['user_lang_model']}}

x

Pronounce

Translate

Collections

Quiz

X

Ok

English

Afrikaans

Albanian

Amharic

Arabic

Armenian

azerbaijan

Basque

Bengali

Bosnian

Bulgarian

Burmese

Catalan

Chinese

Croatian

Czech

Danish

Dutch

Esperanto

Estonian

Filipino

Finnish

French

Galician

Georgian

German

Greek

Gujarati

Hebrew

Hindi

Hungarian

Icelandic

Indonesian

Irish

Italian

Japanese

Javanese

Kannada

Kazakh

Khmer

Korean

Laotian

Latin

Latvian

Lithuanian

Macedonian

Malay

Malayalam

Maltese

Marathi

Mongolian

Nepali

Norwegian

Pashto

Persian

Polish

Portuguese

Romanian

Russian

Serbian

Sinhala

Slovak

Slovenian

Somali

Spanish

Sundanese

Swahili

Swedish

Tamil

Telugu

Thai

Turkish

Ukrainian

Urdu

Uzbek

Vietnamese

Welsh

Zulu

All Languages

English

Arabic

Burmese

Chinese

French

German

Hindi

Indonesian

Italian

Japanese

Korean

Portuguese

Russian

Spanish

Turkish

{{temp['translated_content']}}

Add word

100

Add a pronunciation

150

Add collection

200

Create quiz

500

Log in or

Sign up

Pronunciation

Try to pronounce

Quiz

Collections

Comments

Learn how to pronounce Fsdfsfs

Fsdfsfs

X

X

Rate the pronunciation difficulty of Fsdfsfs

2

/5

(1 Vote)

Very easy

Easy

Moderate

Difficult

Very difficult

Thanks for your vote!

Pronunciation of Fsdfsfs with 1 audio pronunciations

0

rating

rating

ratings

Record the pronunciation of this word in your own voice and play it to listen to how you have pronounced it.

Practice mode

x

x

x

Recording

Click the record button to pronounce

Unfortunately, this browser does not support voice recording. We recommend you to try Safari.

Unfortunately, this device does not support voice recording

Recording

Click the record button again to finish recording

Play

Stop

Record again

Contribute adduse

You can contribute this audio pronunciation of Fsdfsfs to HowToPronounce dictionary.

Contribute

Have you finished your recording?

Yes

No, I want to continue

Have you finished your recording?

Yes

No, I want to continue

Thank you for contributing

Congrats! You've got the pronunciation of Fsdfsfs right. Keep up.

Oops! Seems like your pronunciation of Fsdfsfs is not correct. You can try again.

Original audio

Your audio

Congrats! You have earned {{app.voicePoint}} points

Try again

Since you have exceeded your time limit, your recording has been stopped.

Ok

Can you pronounce this word better

or pronounce in different accent or variation ?

Contribute mode

x

x

x

Recording

Click the record button to pronounce

Unfortunately, this browser does not support voice recording. We recommend you to try Safari.

Unfortunately, this device does not support voice recording

Recording

Click the record button again to finish recording

Play

Stop

Record again

Contribute adduse

You can contribute this audio pronunciation of Fsdfsfs to HowToPronounce dictionary.

Contribute

Have you finished your recording?

Yes

No, I want to continue

Have you finished your recording?

Yes

No, I want to continue

Thank you for contributing

Congrats! You've got the pronunciation of Fsdfsfs right. Keep up.

Oops! Seems like your pronunciation of Fsdfsfs is not correct. You can try again.

Original audio

Your audio

Congrats! You have earned {{app.voicePoint}} points

Try again

Since you have exceeded your time limit, your recording has been stopped.

Ok

Phonetic spelling of Fsdfsfs

Fs-dfsfs

0

rating

rating

ratings

Private

Fsd-f-sfs

0

rating

rating

ratings

Jessica Morgan

Add phonetic spelling

Cancel

Thanks for contributing

You are not logged in..

Please

Log in or

Register

or post as a guest

Submit

Quiz on Fsdfsfs

{{ quiz.name }}

{{ quiz.questions_count }} Questions

Lets play

Show more fewer Quiz

Collections on Fsdfsfs

{{collection.cname}}

{{collection.count}}

View collection

-Private

-{{collection.uname}}

Show more fewer Collections

Popular collections

Celebrities who survived COVID 19

-Private

22

Spanish vocabulary

-Gloria Mary

30

German vocabulary

-Gloria Mary

30

Brands

-Gloria Mary

30

American cities.

-Gloria Mary

31

Celebrities

-Gloria Mary

30

Popular quizzes

Hello Linguists! Take this quiz now!

11

Questions

1432

Attempts

Guess the riddles

4

Questions

4004

Attempts

Guess the App (Food)

10

Questions

3789

Attempts

Windows Operating System

10

Questions

1023

Attempts

Taylor Swift

10

Questions

3417

Attempts

Text Message Abbreviations

15

Questions

2201

Attempts

Trending on HowToPronounce

audio [en]

Gethsemane [en]

Google [en]

Sláinte [en]

Przemyslaw [en]

mateo [en]

estelle [en]

john [en]

Ndiaye [en]

bennett [en]

rafael nadal [en]

Jude Bellingham [en]

Thảo [en]

japheth [en]

Ashleigh [en]

Add Fsdfsfs details

Meanings for Fsdfsfs

Add a meaning

Cancel

Thanks for contributing

You are not logged in..

Please

Log in or

Register

or post as a guest

Submit

Synonyms for Fsdfsfs

Add synonyms

Cancel

Thanks for contributing

You are not logged in..

Please

Log in or

Register

or post as a guest

Submit

Antonyms for Fsdfsfs

Add antonyms

Cancel

Thanks for contributing

You are not logged in..

Please

Log in or

Register

or post as a guest

Submit

Examples of Fsdfsfs in a sentence

Add a sentence

Cancel

Thanks for contributing

Fsdfsfs should be in sentence

You are not logged in..

Please

Log in or

Register

or post as a guest

Submit

Translations of Fsdfsfs

Add a translation

Cancel

Thanks for contributing

Choose a language

Afrikaans

Albanian

Amharic

Arabic

Armenian

azerbaijan

Bashkir

Basque

Belarusian

Bengali

Bosnian

breton

Bulgarian

Burmese

Catalan

Chinese

Croatian

Czech

Danish

Dutch

English

Esperanto

Estonian

Filipino

Finnish

French

Galician

Georgian

German

Greek

Gujarati

haitian

Hawaiian

Hebrew

Hindi

Hungarian

Icelandic

Indonesian

Irish

Italian

Japanese

Javanese

Kannada

Kazakh

Khmer

Korean

Kyrgyz

Laotian

Latin

Latvian

Lithuanian

Luxembourgish

Macedonian

Malagasy

Malay

Malayalam

Maltese

Mandarin Chinese

Maori

Marathi

Mongolian

Nepali

Norwegian

Pashto

Persian

Polish

Portuguese

Punjabi

Romanian

Russian

Scottish Gaelic

Serbian

Sinhala

Slovak

Slovenian

Somali

Spanish

Sundanese

Swahili

Swedish

Tagalog

Tajik

Tamil

Tatar

Telugu

Thai

Turkish

Ukrainian

Urdu

Uzbek

Vietnamese

Welsh

Xhosa

Yiddish

Zulu

You are not logged in..

Please

Log in or

Register

or post as a guest

Submit

Comments about Fsdfsfs

Post

{{comment[1]}}

Reply

Post

{{reply}}

{{comment[0].pname }}

{{comment[0].pname }}

{{comment[0].pmsg}}

Reply

Post

{{reply}}

{{reply.cname }}

{{reply.cname }}

{{reply.cmsg}}

Fsdfsfs pronunciation with meanings, synonyms, antonyms, translations, sentences and more

Which is the exact pronunciation of the name warren buffett?

waa-run buh-fuht

waa-run buh-fuht

vaa-ran baaf-aht

vaa-ran baaf-aht

vaw-ruhn buh-fuht

vaw-ruhn buh-fuht

Pronunciation poll

Vote

Ask your friends

X

X

Word of the day

Providence

[ p-r-AH-v-uh-d-uh-n-s ]

Learn pronunciation

Latest word submissions

Falafel King

[en]

helaslim

[en]

Wurldtech

[en]

Swaav

[en]

Scarlett Solo Studio

[en]

Last updated

March 06, 2024

Recently viewed words

Zainah

[en]

Lukoje

[en]

Halteth

[en]

Krizancic

[en]

Marie Louise Mørkved

[en]

Last updated

March 07, 2024

Flag Word/Pronunciation

×

Embed

Share

Link

×

Create a quiz

×

Hurray! You have unlocked a trophy

{{app.userTrophy[app.userTrophyNo].hints}}

Ok

X

Crowdsourced audio pronunciation dictionary for 89 languages, with meanings, synonyms, sentence usages, translations and much more.

Words

Names

Places

Medicines

Learn the pronunciation of words in

Afrikaans

Albanian

Amharic

Arabic

Armenian

azerbaijan

Basque

Bengali

Bosnian

Bulgarian

Burmese

Catalan

Chinese

Croatian

Czech

Danish

Dutch

English

Esperanto

Estonian

Filipino

Finnish

French

Galician

Georgian

German

Greek

Gujarati

Hebrew

Hindi

Hungarian

Icelandic

Indonesian

Irish

Italian

Japanese

Javanese

Kannada

Kazakh

Khmer

Korean

Laotian

Latin

Latvian

Lithuanian

Macedonian

Malay

Malayalam

Maltese

Marathi

Mongolian

Nepali

Norwegian

Pashto

Persian

Polish

Portuguese

Romanian

Russian

Serbian

Sinhala

Slovak

Slovenian

Somali

Spanish

Sundanese

Swahili

Swedish

Tamil

Telugu

Thai

Turkish

Ukrainian

Urdu

Uzbek

Vietnamese

Welsh

Zulu

Word of the day - in your inbox every day

March 07, 2024

Providence

Learn pronunciation >>

Subscribe to learn and pronounce a new word each day!

Subscribe

Subscribed

please enter a valid email address

© 2024 HowToPronounce. All Rights Reserved

Terms

Privacy

Cookies

Contact us

Advertise with us

×

x

x

Attention Required! | Cloudflare

Attention Required! | Cloudflare

Please enable cookies.

Sorry, you have been blocked

You are unable to access allacronyms.com

Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: 860a03713b220441

Your IP:

Click to reveal

49.157.13.121

Performance & security by Cloudflare